summaryrefslogtreecommitdiff
path: root/tests/024-define-chain-to-self-recursion.c
AgeCommit message (Collapse)Author
2010-05-17Add test and fix bug leading to infinite recursion.Carl Worth
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.