summaryrefslogtreecommitdiffstats
path: root/src/mesa/shader/program_lexer.l
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2009-11-02 12:44:14 -0800
committerIan Romanick <[email protected]>2009-11-02 12:44:14 -0800
commit731810f8546174e45c717b0a9aa289a26593dfa0 (patch)
treeb2bdde3974cdd44b5865b172dc16c1c48e1cf01b /src/mesa/shader/program_lexer.l
parent213ec8251cb3e859b41306eae4092d89592c33db (diff)
ARB prog parser: Fix a couple issues with previous merge from mesa_7_6_branch
Since the addition of support for Nvidia condition codes, the lexer internally uses handle_ident to select between returning IDENTIFIER and USED_IDENTIFIER. Also, use return_string instead of strdup. Fixes bug #24809.
Diffstat (limited to 'src/mesa/shader/program_lexer.l')
-rw-r--r--src/mesa/shader/program_lexer.l8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/mesa/shader/program_lexer.l b/src/mesa/shader/program_lexer.l
index b50fb3c7dc2..e8dae7bc267 100644
--- a/src/mesa/shader/program_lexer.l
+++ b/src/mesa/shader/program_lexer.l
@@ -46,8 +46,7 @@
if (condition) { \
return token; \
} else { \
- yylval->string = return_string(yyextra, yytext); \
- return IDENTIFIER; \
+ return handle_ident(yyextra, yytext, yylval); \
} \
} while (0)
@@ -71,8 +70,7 @@
yylval->temp_inst.Opcode = OPCODE_ ## opcode; \
return token; \
} else { \
- yylval->string = return_string(yyextra, yytext); \
- return IDENTIFIER; \
+ return handle_ident(yyextra, yytext, yylval); \
} \
} while (0)
@@ -163,7 +161,7 @@ swiz_from_char(char c)
static int
handle_ident(struct asm_parser_state *state, const char *text, YYSTYPE *lval)
{
- lval->string = strdup(text);
+ lval->string = return_string(state, text);
return (_mesa_symbol_table_find_symbol(state->st, 0, text) == NULL)
? IDENTIFIER : USED_IDENTIFIER;