aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/glsl/glsl_lexer.ll
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src/glsl/glsl_lexer.ll')
-rw-r--r--mesalib/src/glsl/glsl_lexer.ll9
1 files changed, 6 insertions, 3 deletions
diff --git a/mesalib/src/glsl/glsl_lexer.ll b/mesalib/src/glsl/glsl_lexer.ll
index b7c4aad3a..e66a93591 100644
--- a/mesalib/src/glsl/glsl_lexer.ll
+++ b/mesalib/src/glsl/glsl_lexer.ll
@@ -81,7 +81,8 @@ static int classify_identifier(struct _mesa_glsl_parse_state *, const char *);
"illegal use of reserved word `%s'", yytext); \
return ERROR_TOK; \
} else { \
- yylval->identifier = strdup(yytext); \
+ void *mem_ctx = yyextra; \
+ yylval->identifier = ralloc_strdup(mem_ctx, yytext); \
return classify_identifier(yyextra, yytext); \
} \
} while (0)
@@ -232,7 +233,8 @@ HASH ^{SPC}#{SPC}
<PP>[ \t\r]* { }
<PP>: return COLON;
<PP>[_a-zA-Z][_a-zA-Z0-9]* {
- yylval->identifier = strdup(yytext);
+ void *mem_ctx = yyextra;
+ yylval->identifier = ralloc_strdup(mem_ctx, yytext);
return IDENTIFIER;
}
<PP>[1-9][0-9]* {
@@ -409,7 +411,8 @@ layout {
|| yyextra->ARB_compute_shader_enable) {
return LAYOUT_TOK;
} else {
- yylval->identifier = strdup(yytext);
+ void *mem_ctx = yyextra;
+ yylval->identifier = ralloc_strdup(mem_ctx, yytext);
return classify_identifier(yyextra, yytext);
}
}