mesa/src
Carl Worth 9dacbe2226 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>
2011-04-17 01:02:24 -07:00
..
driclient mesa: Purge macros NEED_EVENTS and NEED_REPLIES 2010-07-01 13:07:07 -06:00
egl egl/wayland: Update to per-surface frame events 2011-04-12 11:08:17 -04:00
gallium r600g: use some loops. 2011-04-17 17:19:28 +10:00
getopt getopt: Make code more portable. 2011-01-12 16:54:21 +00:00
glsl glcpp: Fix attempts to expand recursive macros infinitely (bug #32835). 2011-04-17 01:02:24 -07:00
glu mesa: fix mesa version string construction 2010-10-19 08:59:27 -06:00
glut scons: Revamp how to specify targets to build. 2010-11-01 13:30:22 +00:00
glw Makefiles: Don't complain if depend file to be included doesn't exist. 2010-07-21 13:19:33 -07:00
glx glx: Only remove the glx_display from the list after it's destroyed. 2011-04-10 18:53:34 +02:00
mapi glapi: regenerated files for GL_ARB_sampler_objects 2011-04-10 13:12:49 -06:00
mesa prog_optimize: Add simplify CMP optimization pass 2011-04-16 13:55:55 -07:00
Makefile
SConscript scons: builtin_glsl_function on windows needs bundled getopt. 2011-02-11 20:09:26 +00:00