Giovanni Mascellani (@giomasce) commented about libs/vkd3d-shader/dxil.c:
+{
- struct sm6_block_terminator *terminator = &code_block->terminator;
- const struct sm6_type *type;
- const struct sm6_value *src;
- unsigned int i = 1, j;
- if (record->operand_count < 3 || !(record->operand_count & 1))
- {
WARN("Invalid operand count %u.\n", record->operand_count);
vkd3d_shader_parser_error(&sm6->p, VKD3D_SHADER_ERROR_DXIL_INVALID_OPERAND_COUNT,
"Invalid operand count %u for a switch instruction.", record->operand_count);
return;
- }
- if (!(type = sm6_parser_get_type(sm6, record->operands[0])))
return;
Would it make sense to validate the type? I guess, for example, that int64 or non-scalar types are not allowed here.