aboutsummaryrefslogtreecommitdiff
path: root/gdb/c-exp.y
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2020-03-20 08:10:59 -0600
committerTom Tromey <tromey@adacore.com>2020-03-20 08:31:17 -0600
commitf7d4f0b1b9519fa10eb04cb195bdf7b5044d73c7 (patch)
tree467d4c10ad2cfd4c0f98497e0bdf8b3f40f4321e /gdb/c-exp.y
parentf67210ff1c4200ea668189d086c6b39145cd876f (diff)
downloadgdb-f7d4f0b1b9519fa10eb04cb195bdf7b5044d73c7.zip
gdb-f7d4f0b1b9519fa10eb04cb195bdf7b5044d73c7.tar.gz
gdb-f7d4f0b1b9519fa10eb04cb195bdf7b5044d73c7.tar.bz2
Fix assert in c-exp.y
The "restrict" patch added some asserts to c-exp.y, but one spot was copy-pasted and referred to the wrong table. This was pointed out by -fsanitize=address. This patch fixes the bug. gdb/ChangeLog 2020-03-20 Tom Tromey <tromey@adacore.com> * c-exp.y (lex_one_token): Fix assert.
Diffstat (limited to 'gdb/c-exp.y')
-rw-r--r--gdb/c-exp.y2
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/c-exp.y b/gdb/c-exp.y
index 50a2eef..a4efaab 100644
--- a/gdb/c-exp.y
+++ b/gdb/c-exp.y
@@ -2580,7 +2580,7 @@ lex_one_token (struct parser_state *par_state, bool *is_quoted_name)
if ((tokentab2[i].flags & FLAG_CXX) != 0
&& par_state->language ()->la_language != language_cplus)
break;
- gdb_assert ((tokentab3[i].flags & FLAG_C) == 0);
+ gdb_assert ((tokentab2[i].flags & FLAG_C) == 0);
pstate->lexptr += 2;
yylval.opcode = tokentab2[i].opcode;