d3dcompiler: Don't allow semantics on local variables.

This commit is contained in:
Matteo Bruni 2012-07-18 16:25:13 +02:00 committed by Alexandre Julliard
parent 110045816c
commit 7293c1c0fe
1 changed files with 6 additions and 1 deletions

View File

@ -143,6 +143,12 @@ static BOOL declare_variable(struct hlsl_ir_var *decl, BOOL local)
hlsl_report_message(decl->node.loc.file, decl->node.loc.line, decl->node.loc.col, HLSL_LEVEL_ERROR, hlsl_report_message(decl->node.loc.file, decl->node.loc.line, decl->node.loc.col, HLSL_LEVEL_ERROR,
"modifier '%s' invalid for local variables", debug_modifiers(invalid)); "modifier '%s' invalid for local variables", debug_modifiers(invalid));
} }
if (decl->semantic)
{
hlsl_report_message(decl->node.loc.file, decl->node.loc.line, decl->node.loc.col, HLSL_LEVEL_ERROR,
"semantics are not allowed on local variables");
return FALSE;
}
} }
else else
{ {
@ -685,7 +691,6 @@ variables_def: variable_def
list_add_tail($$, &$3->entry); list_add_tail($$, &$3->entry);
} }
/* FIXME: Local variables can't have semantics. */
variable_def: any_identifier array semantic variable_def: any_identifier array semantic
{ {
$$ = d3dcompiler_alloc(sizeof(*$$)); $$ = d3dcompiler_alloc(sizeof(*$$));