From 420d05a15b90658680b87b4d83b092768590319a Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Mon, 17 May 2010 10:15:23 -0700 Subject: Add test and fix bug leading to infinite recursion. The test case here is simply "#define foo foo" and "#define bar foo" and then attempting to expand "bar". Previously, our termination condition for the recursion was overly simple---just looking for the single identifier that began the expansion. We now fix this to maintain a stack of identifiers and terminate when any one of them occurs in the replacement list. --- tests/024-define-chain-to-self-recursion.c | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 tests/024-define-chain-to-self-recursion.c (limited to 'tests') diff --git a/tests/024-define-chain-to-self-recursion.c b/tests/024-define-chain-to-self-recursion.c new file mode 100644 index 0000000000..e788adce30 --- /dev/null +++ b/tests/024-define-chain-to-self-recursion.c @@ -0,0 +1,3 @@ +#define foo foo +#define bar foo +bar -- cgit v1.2.3