Giovanni Mascellani (@giomasce) commented about libs/vkd3d-shader/hlsl.y:
hlsl_pop_scope(ctx); }
+switch_statement:
attribute_list_optional switch_scope_start KW_SWITCH '(' expr ')' '{' switch_cases '}'
{
struct hlsl_ir_node *selector = node_from_block($5);
struct hlsl_ir_node *s;
if (!(selector = add_implicit_conversion(ctx, $5, selector, hlsl_get_scalar_type(ctx, HLSL_TYPE_UINT), &@5)))
YYABORT;
if (!(s = hlsl_new_switch(ctx, selector, $8, &@3)))
YYABORT;
I think I should already have learned that by now, but what are the obligations we have when we `YYABORT` to avoid leaking resources? I guess we should at least cleanup the input variables (`$1` etc), I don't know about `$$`. Maybe @zfigura can help?