summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorCarl Worth <cworth@cworth.org>2011-04-15 12:03:25 -0700
committerKenneth Graunke <kenneth@whitecape.org>2011-04-17 01:02:24 -0700
commit9dacbe222641443af000a82161922a5ade206340 (patch)
treeb296b08387cc633488ed6380c4785c3f6b8de554 /src/mesa
parent93d42571a631cb273df15fc1930e5b27f2970d9b (diff)
downloadexternal_mesa3d-9dacbe222641443af000a82161922a5ade206340.zip
external_mesa3d-9dacbe222641443af000a82161922a5ade206340.tar.gz
external_mesa3d-9dacbe222641443af000a82161922a5ade206340.tar.bz2
glcpp: Fix attempts to expand recursive macros infinitely (bug #32835).
The 095-recursive-define test case was triggering infinite recursion with the following test case: #define A(a, b) B(a, b) #define C A(0, C) C Here's what was happening: 1. "C" was pushed onto the active list to expand the C node 2. While expanding the "0" argument, the active list would be emptied by the code at the end of _glcpp_parser_expand_token_list 3. When expanding the "C" argument, the active list was now empty, so lather, rinse, repeat. We fix this by adjusting the final popping at the end of _glcpp_parser_expand_token_list to never pop more nodes then this particular invocation had pushed itself. This is as simple as saving the original state of the active list, and then interrupting the popping when we reach this same state. With this fix, all of the glcpp-test tests now pass. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=32835 Signed-off-by: Carl Worth <cworth@cworth.org> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-and-tested-by: Kenneth Graunke <kenneth@whitecape.org>
Diffstat (limited to 'src/mesa')
0 files changed, 0 insertions, 0 deletions