diff options
Diffstat (limited to 'gcc/cpplex.c')
-rw-r--r-- | gcc/cpplex.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/gcc/cpplex.c b/gcc/cpplex.c index b0d3f5f..a57eb8b 100644 --- a/gcc/cpplex.c +++ b/gcc/cpplex.c @@ -604,7 +604,12 @@ _cpp_parse_assertion (pfile) int c, dropwhite; _cpp_skip_hspace (pfile); c = PEEKC(); - if (! is_idstart(c)) + if (c == '\n') + { + cpp_error (pfile, "assertion without predicate"); + return 0; + } + else if (! is_idstart(c)) { cpp_error (pfile, "assertion predicate is not an identifier"); return 0; @@ -709,8 +714,9 @@ _cpp_lex_token (pfile) if (pfile->parsing_if_directive) { _cpp_skip_hspace (pfile); - _cpp_parse_assertion (pfile); - return CPP_ASSERTION; + if (_cpp_parse_assertion (pfile)) + return CPP_ASSERTION; + goto randomchar; } if (pfile->parsing_define_directive && ! CPP_TRADITIONAL (pfile)) |