vkd3d-shader/dxil: Handle sm6_parser_add_instruction() returning NULL.

Only calls to sm6_parser_add_instruction() where we are using the
returned vkd3d_shader_instruction are checked for, since these return
values might cause NULL dereferences if unchecked.

Other calls to sm6_parser_add_instruction() can be left alone since the
error is still recorded via sm6->p.status.
This commit is contained in:
Francisco Casas
2025-10-01 13:21:58 -03:00
committed by Henri Verbeet
parent bdba25d028
commit aa943c51ea
Notes: Henri Verbeet 2025-10-03 00:55:08 +02:00
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1761
3 changed files with 69 additions and 35 deletions

View File

@@ -1085,13 +1085,6 @@ static bool vsir_instruction_is_dcl(const struct vkd3d_shader_instruction *instr
|| opcode == VSIR_OP_HS_DECLS;
}
static void vkd3d_shader_instruction_make_nop(struct vkd3d_shader_instruction *ins)
{
struct vkd3d_shader_location location = ins->location;
vsir_instruction_init(ins, &location, VSIR_OP_NOP);
}
/* NOTE: Immediate constant buffers are not cloned, so the source must not be destroyed while the
* destination is in use. This seems like a reasonable requirement given how this is currently used. */
static bool vsir_program_iterator_clone_instruction(struct vsir_program *program,