mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-01-28 13:05:02 -08:00
vkd3d-shader/hlsl: Do not abort parsing when invalid modifiers are used.
This commit is contained in:
parent
9c70348b39
commit
97eac342d3
Notes:
Henri Verbeet
2024-12-03 14:56:02 +01:00
Approved-by: Francisco Casas (@fcasas) Approved-by: Henri Verbeet (@hverbeet) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1233
@ -8110,14 +8110,9 @@ typedef:
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (modifiers)
|
if (modifiers)
|
||||||
{
|
|
||||||
hlsl_error(ctx, &@1, VKD3D_SHADER_ERROR_HLSL_INVALID_MODIFIER,
|
hlsl_error(ctx, &@1, VKD3D_SHADER_ERROR_HLSL_INVALID_MODIFIER,
|
||||||
"Storage modifiers are not allowed on typedefs.");
|
"Storage modifiers are not allowed on typedefs.");
|
||||||
LIST_FOR_EACH_ENTRY_SAFE(v, v_next, $4, struct parse_variable_def, entry)
|
|
||||||
vkd3d_free(v);
|
|
||||||
vkd3d_free($4);
|
|
||||||
YYABORT;
|
|
||||||
}
|
|
||||||
if (!add_typedef(ctx, type, $4))
|
if (!add_typedef(ctx, type, $4))
|
||||||
YYABORT;
|
YYABORT;
|
||||||
}
|
}
|
||||||
@ -9171,12 +9166,9 @@ postfix_expr:
|
|||||||
| var_modifiers type '(' initializer_expr_list ')'
|
| var_modifiers type '(' initializer_expr_list ')'
|
||||||
{
|
{
|
||||||
if ($1)
|
if ($1)
|
||||||
{
|
|
||||||
hlsl_error(ctx, &@1, VKD3D_SHADER_ERROR_HLSL_INVALID_MODIFIER,
|
hlsl_error(ctx, &@1, VKD3D_SHADER_ERROR_HLSL_INVALID_MODIFIER,
|
||||||
"Modifiers are not allowed on constructors.");
|
"Modifiers are not allowed on constructors.");
|
||||||
free_parse_initializer(&$4);
|
|
||||||
YYABORT;
|
|
||||||
}
|
|
||||||
if (!hlsl_is_numeric_type($2))
|
if (!hlsl_is_numeric_type($2))
|
||||||
{
|
{
|
||||||
struct vkd3d_string_buffer *string;
|
struct vkd3d_string_buffer *string;
|
||||||
@ -9255,11 +9247,8 @@ unary_expr:
|
|||||||
| '(' var_modifiers type arrays ')' unary_expr
|
| '(' var_modifiers type arrays ')' unary_expr
|
||||||
{
|
{
|
||||||
if ($2)
|
if ($2)
|
||||||
{
|
|
||||||
hlsl_error(ctx, &@2, VKD3D_SHADER_ERROR_HLSL_INVALID_MODIFIER,
|
hlsl_error(ctx, &@2, VKD3D_SHADER_ERROR_HLSL_INVALID_MODIFIER,
|
||||||
"Modifiers are not allowed on casts.");
|
"Modifiers are not allowed on casts.");
|
||||||
YYABORT;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!add_explicit_conversion(ctx, $6, $3, &$4, &@3))
|
if (!add_explicit_conversion(ctx, $6, $3, &$4, &@3))
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user