Add test and fix bug leading to infinite recursion.
authorCarl Worth <cworth@cworth.org>
Mon, 17 May 2010 17:15:23 +0000 (10:15 -0700)
committerCarl Worth <cworth@cworth.org>
Mon, 17 May 2010 17:15:23 +0000 (10:15 -0700)
commit420d05a15b90658680b87b4d83b092768590319a
tree52a5a0ffc1e4919ee08c2e1add30d78d8fbc6d4c
parente36a4d5be9a9fa3abc4fb5d0b6c3601934f7a343
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.
glcpp-parse.y
tests/024-define-chain-to-self-recursion.c [new file with mode: 0644]