From d8f233201baa7f3f6361a268587013694e160231 Mon Sep 17 00:00:00 2001 From: Peter Schauer Date: Wed, 28 Apr 1993 20:36:48 +0000 Subject: [PATCH] * ch-exp.y (yylex): Don't STREQ with simplename if it is NULL. --- gdb/ChangeLog | 4 ++++ gdb/ch-exp.y | 42 +++++++++++++++++++++--------------------- 2 files changed, 25 insertions(+), 21 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index fbae261b420..4c6a7f4374c 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +Wed Apr 28 13:27:54 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * ch-exp.y (yylex): Don't STREQ with simplename if it is NULL. + Wed Apr 28 06:11:38 1993 Jim Kingdon (kingdon@cygnus.com) * config/sparc/xm-sun4os4.h [__STDC__]: Don't use MALLOC_INCOMPATIBLE. diff --git a/gdb/ch-exp.y b/gdb/ch-exp.y index 952e2b38d2b..2789d76767a 100644 --- a/gdb/ch-exp.y +++ b/gdb/ch-exp.y @@ -1883,29 +1883,29 @@ yylex () simplename = match_simple_name_string (); - /* See if it is a reserved identifier. */ - for (i = 0; i < sizeof (idtokentab) / sizeof (idtokentab[0]); i++) - { - if (STREQ (simplename, idtokentab[i].operator)) - { - return (idtokentab[i].token); - } - } - - /* Look for other special tokens. */ - if (STREQ (simplename, "true")) - { - yylval.ulval = 1; - return (BOOLEAN_LITERAL); - } - if (STREQ (simplename, "false")) - { - yylval.ulval = 0; - return (BOOLEAN_LITERAL); - } - if (simplename != NULL) { + /* See if it is a reserved identifier. */ + for (i = 0; i < sizeof (idtokentab) / sizeof (idtokentab[0]); i++) + { + if (STREQ (simplename, idtokentab[i].operator)) + { + return (idtokentab[i].token); + } + } + + /* Look for other special tokens. */ + if (STREQ (simplename, "true")) + { + yylval.ulval = 1; + return (BOOLEAN_LITERAL); + } + if (STREQ (simplename, "false")) + { + yylval.ulval = 0; + return (BOOLEAN_LITERAL); + } + sym = lookup_symbol (simplename, expression_context_block, VAR_NAMESPACE, (int *) NULL, (struct symtab **) NULL); -- 2.30.2