* 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
+Sat 16-Sep-2000 08:13:45 BST Neil Booth <NeilB@earthling.net>
+
+ * cpplex.c (push_macro_context): Set an argument's level after
+ calling parse_args. We could loop infinitely otherwise.
+
2000-09-15 Tom Tromey <tromey@cygnus.com>
* configure, config.in: Rebuilt.
args->tokens = 0;
args->capacity = 0;
args->used = 0;
- args->level = pfile->cur_context;
prev_nme = prevent_macro_expansion (pfile);
pfile->args = args;
free_macro_args (args);
return 1;
}
+ /* Set the level after the call to parse_args. */
+ args->level = pfile->cur_context;
}
/* Now push its context. */
+Sat 16-Sep-2000 08:14:58 BST Neil Booth <NeilB@earthling.net>
+
+ * gcc.dg/cpp/macro2.c: Testcase for multi-context arguments
+ in nested macro bug.
+
Fri 15-Sep-2000 06:50:11 BST Neil Booth <NeilB@earthling.net>
* gcc.dg/cpp/paste10.c: Testcase for PASTE_LEFT buglet.
--- /dev/null
+/* Copyright (C) 2000 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+
+/* Tests the argument context get set at the lower level if we drop
+ contexts whilst parsing arguments. This would enter an infinite
+ loop in is_macro_disabled previously. */
+
+#define A Something
+#define B C
+#define C K(
+#define K(S) S
+#define T B A )
+T /* Expands to <Something>. */