glcpp: Fix function-like macros with an argument used multiple times.
authorCarl Worth <cworth@cworth.org>
Thu, 22 Jul 2010 23:36:04 +0000 (16:36 -0700)
committerCarl Worth <cworth@cworth.org>
Thu, 22 Jul 2010 23:38:12 +0000 (16:38 -0700)
commitfbe4240626bfe102a9c4c889ee18cb9ea27bddec
treedf8e7fdcfc73a32972a2605e5c9db248f86b9f41
parenta0879b9dd438d78635f047cdd5ed4c72bc831b60
glcpp: Fix function-like macros with an argument used multiple times.

It's really hard to believe that this case has been broken, but apparently
no test previously exercised it. So this commit adds such a test and fixes
it by making a copy of the argument token-list before expanding it.

This fix causes the following glean tests to now pass:

glsl1-Preprocessor test 6 (#if 0, #define macro)
glsl1-Preprocessor test 7 (multi-line #define)
src/glsl/glcpp/glcpp-parse.y
src/glsl/glcpp/tests/069-repeated-argument.c [new file with mode: 0644]