Mesa (9.0): glcpp: fix abuse of yylex

Dave Airlie airlied at kemper.freedesktop.org
Fri Sep 14 22:28:50 UTC 2012


Module: Mesa
Branch: 9.0
Commit: 8f7990c5f2ca25e42c7fefff6312bee2ff77e134
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=8f7990c5f2ca25e42c7fefff6312bee2ff77e134

Author: Dave Airlie <airlied at gmail.com>
Date:   Fri Sep 14 19:59:54 2012 +1000

glcpp: fix abuse of yylex

So glcpp tried to workaround yylex its own way, but failed,
do it properly.

This fixes another crash found after fixing the first crash.

this is a candidate for 9.0 and stable branches

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Signed-off-by: Dave Airlie <airlied at redhat.com>
(cherry picked from commit 53d46bc787318ccf9911fdd1d5fe99ee4db7f41a)

---

 src/glsl/glcpp/Makefile.am   |    2 +-
 src/glsl/glcpp/glcpp-parse.y |    8 --------
 2 files changed, 1 insertions(+), 9 deletions(-)

diff --git a/src/glsl/glcpp/Makefile.am b/src/glsl/glcpp/Makefile.am
index 7a95b68..87affce 100644
--- a/src/glsl/glcpp/Makefile.am
+++ b/src/glsl/glcpp/Makefile.am
@@ -31,7 +31,7 @@ AM_CFLAGS = \
 	$(LIBRARY_DEFINES) \
 	$(API_DEFINES)
 
-AM_YFLAGS = -v -d
+AM_YFLAGS = -v -d -p "glcpp_parser_"
 AM_LFLAGS = --nounistd -o$(LEX_OUTPUT_ROOT).c
 
 noinst_LTLIBRARIES = libglcpp.la
diff --git a/src/glsl/glcpp/glcpp-parse.y b/src/glsl/glcpp/glcpp-parse.y
index bf6f3ad..fb9bc58 100644
--- a/src/glsl/glcpp/glcpp-parse.y
+++ b/src/glsl/glcpp/glcpp-parse.y
@@ -133,8 +133,6 @@ _glcpp_parser_skip_stack_change_if (glcpp_parser_t *parser, YYLTYPE *loc,
 static void
 _glcpp_parser_skip_stack_pop (glcpp_parser_t *parser, YYLTYPE *loc);
 
-#define yylex glcpp_parser_lex
-
 static int
 glcpp_parser_lex (YYSTYPE *yylval, YYLTYPE *yylloc, glcpp_parser_t *parser);
 
@@ -1197,12 +1195,6 @@ glcpp_parser_create (const struct gl_extensions *extensions, int api)
 	return parser;
 }
 
-int
-glcpp_parser_parse (glcpp_parser_t *parser)
-{
-	return yyparse (parser);
-}
-
 void
 glcpp_parser_destroy (glcpp_parser_t *parser)
 {




More information about the mesa-commit mailing list