From 388ab9fa6b468d8c162dd4fc645d2f758c49051c Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Wed, 7 Jul 2010 11:40:51 -0700 Subject: [PATCH] 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(+) diff --git a/src/glsl/glcpp/glcpp-lex.l b/src/glsl/glcpp/glcpp-lex.l index 6a91b09954a..53e85556c16 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 ddaa19db722..6c1000876e1 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 -- 2.30.2