Commit 422c6060 by Richard Kenner

(parse_c_expression): Don't check for null lexptr or *lexptr == 0.

(parse_c_expression): Don't check for null lexptr or *lexptr == 0.  If
yyparse returns nonzero value, abort.

From-SVN: r13655
parent a5ac8bef
...@@ -1043,20 +1043,15 @@ parse_c_expression (string) ...@@ -1043,20 +1043,15 @@ parse_c_expression (string)
{ {
lexptr = string; lexptr = string;
if (lexptr == 0 || *lexptr == 0) {
error ("empty #if expression");
return 0; /* don't include the #if group */
}
/* if there is some sort of scanning error, just return 0 and assume /* if there is some sort of scanning error, just return 0 and assume
the parsing routine has printed an error message somewhere. the parsing routine has printed an error message somewhere.
there is surely a better thing to do than this. */ there is surely a better thing to do than this. */
if (setjmp (parse_return_error)) if (setjmp (parse_return_error))
return 0; return 0;
if (yyparse ()) if (yyparse () != 0)
return 0; /* actually this is never reached abort ();
the way things stand. */
if (*lexptr != '\n') if (*lexptr != '\n')
error ("Junk after end of expression."); error ("Junk after end of expression.");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment