summaryrefslogtreecommitdiff
path: root/glcpp-lex.l
diff options
context:
space:
mode:
Diffstat (limited to 'glcpp-lex.l')
-rw-r--r--glcpp-lex.l7
1 files changed, 4 insertions, 3 deletions
diff --git a/glcpp-lex.l b/glcpp-lex.l
index f1a3560779..ec91538a73 100644
--- a/glcpp-lex.l
+++ b/glcpp-lex.l
@@ -30,6 +30,7 @@
%}
%option reentrant noyywrap
+%option extra-type="glcpp_parser_t *"
%x ST_DEFINE
%x ST_DEFVAL
@@ -50,12 +51,12 @@ TOKEN {NONSPACE}+
}
<ST_DEFINE>{IDENTIFIER} {
- yylval.str = strdup (yytext);
+ yylval.str = xtalloc_strdup (yyextra, yytext);
return IDENTIFIER;
}
<ST_DEFINE>{TOKEN} {
- yylval.str = strdup (yytext);
+ yylval.str = xtalloc_strdup (yyextra, yytext);
return TOKEN;
}
@@ -68,7 +69,7 @@ TOKEN {NONSPACE}+
/* Anything we don't specifically recognize is a stream of tokens */
{NONSPACE}+ {
- yylval.str = strdup (yytext);
+ yylval.str = xtalloc_strdup (yyextra, yytext);
return TOKEN;
}