public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
From: Tom Tromey <tromey@sourceware.org>
To: gdb-cvs@sourceware.org
Subject: [binutils-gdb] Fix assert in c-exp.y
Date: Fri, 20 Mar 2020 14:36:44 +0000 (GMT)	[thread overview]
Message-ID: <20200320143644.A3C6E385F024@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=f7d4f0b1b9519fa10eb04cb195bdf7b5044d73c7

commit f7d4f0b1b9519fa10eb04cb195bdf7b5044d73c7
Author: Tom Tromey <tromey@adacore.com>
Date:   Fri Mar 20 08:10:59 2020 -0600

    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.

Diff:
---
 gdb/ChangeLog | 4 ++++
 gdb/c-exp.y   | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 583ec9c81e3..1be14b15d18 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -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.
diff --git a/gdb/c-exp.y b/gdb/c-exp.y
index 50a2eef98b5..a4efaab79c8 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;


                 reply	other threads:[~2020-03-20 14:36 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200320143644.A3C6E385F024@sourceware.org \
    --to=tromey@sourceware.org \
    --cc=gdb-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).