]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Fix out-of-bounds array access found by mudflap.
authorJames E Wilson <wilson@specifixinc.com>
Wed, 23 Feb 2005 22:16:07 +0000 (22:16 +0000)
committerJim Wilson <wilson@gcc.gnu.org>
Wed, 23 Feb 2005 22:16:07 +0000 (14:16 -0800)
* gengtype.c (note_insn_name): Make 1 element larger.

From-SVN: r95473

gcc/ChangeLog
gcc/gengtype.c

index 675583654ce81b8339365daeb28d99faeddc44e8..7873232a6034e78c8df1ad89d17d02fb8677ead8 100644 (file)
@@ -1,3 +1,7 @@
+2005-02-23  James E Wilson  <wilson@specifixinc.com>
+
+       * gengtype.c (note_insn_name): Make 1 element larger.
+
 2005-02-23  Roger Sayle  <roger@eyesopen.com>
 
        PR target/20018
index ad2c880ee51eda2d1f21caa29597501884fceffc..e3de82259495f1c87dbc63b110b53345f4b498a5 100644 (file)
@@ -367,7 +367,9 @@ enum insn_note {
   NOTE_INSN_MAX
 };
 
-static const char *const note_insn_name[NOTE_INSN_MAX] = {
+/* We must allocate one more entry here, as we use NOTE_INSN_MAX as the
+   default field for line number notes.  */
+static const char *const note_insn_name[NOTE_INSN_MAX+1] = {
 #define DEF_INSN_NOTE(NAME) #NAME,
 #include "insn-notes.def"
 #undef DEF_INSN_NOTE