Giovanni Mascellani (@giomasce) commented about libs/vkd3d-shader/hlsl.y:
KW_IF '(' expr ')' if_body { struct hlsl_ir_node *condition = node_from_list($3);
struct hlsl_block then_block, else_block; struct hlsl_ir_node *instr;
hlsl_block_init(&then_block);
list_move_tail(&then_block.instrs, $5.then_block);
hlsl_block_init(&else_block);
if ($5.else_block)
list_move_tail(&else_block.instrs, $5.else_block);
if (!(instr = hlsl_new_if(ctx, condition, $5.then_block, $5.else_block, &@1)))
{
vkd3d_free($5.then_block);
Shouldn't these be `hlsl_block_cleanup()`? Who else owns the contained instructions, otherwise?