Mesa (glsl2): glsl2: Initialize yylineno and yycolumn so line numbers are sane.

Ian Romanick idr at kemper.freedesktop.org
Wed Jul 7 19:45:33 UTC 2010


Module: Mesa
Branch: glsl2
Commit: 388ab9fa6b468d8c162dd4fc645d2f758c49051c
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=388ab9fa6b468d8c162dd4fc645d2f758c49051c

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Wed Jul  7 11:40:51 2010 -0700

glsl2: Initialize yylineno and yycolumn so line numbers are sane.

---

 src/glsl/glcpp/glcpp-lex.l |    1 +
 src/glsl/glsl_lexer.lpp    |    2 ++
 2 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/glsl/glcpp/glcpp-lex.l b/src/glsl/glcpp/glcpp-lex.l
index 6a91b09..53e8555 100644
--- a/src/glsl/glcpp/glcpp-lex.l
+++ b/src/glsl/glcpp/glcpp-lex.l
@@ -36,6 +36,7 @@
       yylloc->first_line = yylineno;                            \
       yycolumn += yyleng;                                       \
    } while(0);
+#define YY_USER_INIT yylineno = 0; yycolumn = 0;
 %}
 
 %option bison-bridge bison-locations reentrant noyywrap
diff --git a/src/glsl/glsl_lexer.lpp b/src/glsl/glsl_lexer.lpp
index ddaa19d..6c10008 100644
--- a/src/glsl/glsl_lexer.lpp
+++ b/src/glsl/glsl_lexer.lpp
@@ -34,6 +34,8 @@
       yycolumn += yyleng;					\
    } while(0);
 
+#define YY_USER_INIT yylineno = 0; yycolumn = 0;
+
 %}
 
 %option bison-bridge bison-locations reentrant noyywrap




More information about the mesa-commit mailing list