diff options
author | Neil Booth <neilb@earthling.net> | 2000-09-16 07:18:06 +0000 |
---|---|---|
committer | Neil Booth <neil@gcc.gnu.org> | 2000-09-16 07:18:06 +0000 |
commit | 08ebc1c594f6ed0aaa4a55e865823c4cee885d4c (patch) | |
tree | 00ba9b3bf0ea085e6567ae8757f031718f05cf5b /gcc/cpplex.c | |
parent | d9fbca261ef44d0d58573baff8719a6a01ed0bca (diff) | |
download | gcc-08ebc1c594f6ed0aaa4a55e865823c4cee885d4c.zip gcc-08ebc1c594f6ed0aaa4a55e865823c4cee885d4c.tar.gz gcc-08ebc1c594f6ed0aaa4a55e865823c4cee885d4c.tar.bz2 |
cpplex.c (push_macro_context): Set an argument's level after calling parse_args.
* cpplex.c (push_macro_context): Set an argument's level after
calling parse_args. We could loop infinitely otherwise.
* gcc.dg/cpp/macro2.c: New testcase.
From-SVN: r36452
Diffstat (limited to 'gcc/cpplex.c')
-rw-r--r-- | gcc/cpplex.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/cpplex.c b/gcc/cpplex.c index 56b8543..970b35f 100644 --- a/gcc/cpplex.c +++ b/gcc/cpplex.c @@ -2972,7 +2972,6 @@ push_macro_context (pfile, token) args->tokens = 0; args->capacity = 0; args->used = 0; - args->level = pfile->cur_context; prev_nme = prevent_macro_expansion (pfile); pfile->args = args; @@ -2984,6 +2983,8 @@ push_macro_context (pfile, token) free_macro_args (args); return 1; } + /* Set the level after the call to parse_args. */ + args->level = pfile->cur_context; } /* Now push its context. */ |