summaryrefslogtreecommitdiff
path: root/gcc/gengtype.c
diff options
context:
space:
mode:
authorwilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4>2005-02-23 22:16:07 +0000
committerwilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4>2005-02-23 22:16:07 +0000
commitab6994d2fcf91b5ed7597812187671f669c4c43f (patch)
tree00aa2be2b452a3b6ceaaef2bbda96423fd572118 /gcc/gengtype.c
parent2ef746b7aa6b477efd6358a950ffc6c880ab519e (diff)
downloadgcc-ab6994d2fcf91b5ed7597812187671f669c4c43f.tar.gz
Fix out-of-bounds array access found by mudflap.
* gengtype.c (note_insn_name): Make 1 element larger. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@95473 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gengtype.c')
-rw-r--r--gcc/gengtype.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/gengtype.c b/gcc/gengtype.c
index ad2c880ee51..e3de8225949 100644
--- a/gcc/gengtype.c
+++ b/gcc/gengtype.c
@@ -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