22 Mar
2024
22 Mar
'24
9:12 p.m.
Zebediah Figura (@zfigura) commented about libs/vkd3d-shader/hlsl.y:
state_block: %empty - | state_block state + { + if (!($$ = hlsl_alloc(ctx, sizeof(*$$)))) + YYABORT; + } + | state_block any_identifier '[' C_INTEGER ']' '=' complex_initializer ';'
You could probably avoid the duplication with a separate "%empty | [int]" rule. Or alternatively use "arrays" and add an explicit check for count > 1. Is C_INTEGER correct here, or should we allow compile-time constants? -- https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/739#note_65846