mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 09:18:04 +02:00
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.
This commit is contained in:
parent
213ec8251c
commit
731810f854
2 changed files with 200 additions and 190 deletions
File diff suppressed because it is too large
Load diff
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue