aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Stallman <rms@gnu.org>1993-01-09 02:56:59 +0000
committerRichard Stallman <rms@gnu.org>1993-01-09 02:56:59 +0000
commit8355fc27ae6216450e374c325b6ca49adf6e2b41 (patch)
tree52a1d9d68a86d56c23de2625e7bae8cc965733c0
parent10055ae2439dec264961a7a52131f8f1d40779af (diff)
downloadgcc-8355fc27ae6216450e374c325b6ca49adf6e2b41.zip
gcc-8355fc27ae6216450e374c325b6ca49adf6e2b41.tar.gz
gcc-8355fc27ae6216450e374c325b6ca49adf6e2b41.tar.bz2
(yylex): Don't allow @ in identifier outside of Objective C.
From-SVN: r3163
-rw-r--r--gcc/c-lex.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/c-lex.c b/gcc/c-lex.c
index 4c773e1..d877176 100644
--- a/gcc/c-lex.c
+++ b/gcc/c-lex.c
@@ -1096,11 +1096,15 @@ yylex ()
p = token_buffer;
while (isalnum (c) || c == '_' || c == '$' || c == '@')
{
- if (p >= token_buffer + maxtoken)
- p = extend_token_buffer (p);
+ /* Make sure this char really belongs in an identifier. */
+ if (c == '@' && ! doing_objc_thang)
+ break;
if (c == '$' && ! dollars_in_ident)
break;
+ if (p >= token_buffer + maxtoken)
+ p = extend_token_buffer (p);
+
*p++ = c;
c = getc (finput);
}