13 Oct
2023
13 Oct
'23
10:32 a.m.
Giovanni Mascellani (@giomasce) commented about libs/vkd3d-shader/hlsl.c:
+ + hlsl_block_init(&c->body); + if (body) + hlsl_block_add_block(&c->body, body); + c->loc = *loc; + + return c; +} + +struct hlsl_ir_node *hlsl_new_switch(struct hlsl_ctx *ctx, struct hlsl_ir_node *selector, + struct list *cases, const struct vkd3d_shader_location *loc) +{ + struct hlsl_ir_switch *s; + + if (!(s = hlsl_alloc(ctx, sizeof(*s)))) + return NULL; This has a similar problem to `hlsl_new_switch_case()`: if you return here the content of `cases` is leaked.
-- https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/361#note_48630