Fix assert in c-exp.y
authorTom Tromey <tromey@adacore.com>
Fri, 20 Mar 2020 14:10:59 +0000 (08:10 -0600)
committerTom Tromey <tromey@adacore.com>
Fri, 20 Mar 2020 14:31:17 +0000 (08:31 -0600)
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.

gdb/ChangeLog
gdb/c-exp.y

index 583ec9c81e32c9a5961c61796a9d4e8afa963889..1be14b15d185db272902ab985b27707651a7b0ef 100644 (file)
@@ -1,3 +1,7 @@
+2020-03-20  Tom Tromey  <tromey@adacore.com>
+
+       * c-exp.y (lex_one_token): Fix assert.
+
 2020-03-20  Tom Tromey  <tromey@adacore.com>
 
        * ada-tasks.c (read_atcb): Use smaller length in strncpy call.
index 50a2eef98b58614bf41cafada3359167e92bae8f..a4efaab79c8142277d9a1405a5dea087c4c33aef 100644 (file)
@@ -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;
This page took 0.026946 seconds and 4 git commands to generate.