Giovanni Mascellani (@giomasce) commented about libs/vkd3d-shader/dxil.c:
}
+static enum vkd3d_result sm6_parser_init_constexpr_gep(struct sm6_parser *sm6, const struct dxil_record *record,
struct sm6_value *dst)
+{
- const struct sm6_type *elem_type, *pointee_type, *gep_type, *ptr_type;
- unsigned int i, j, operand_count, offset;
- struct sm6_value *operands[3];
- uint64_t value;
- i = 0;
- pointee_type = (record->operand_count & 1) ? sm6_parser_get_type(sm6, record->operands[i++]) : NULL;
- if (!dxil_record_validate_operand_count(record, i + 6, i + 6, sm6))
return VKD3D_ERROR_INVALID_SHADER;
- operand_count = min(record->operand_count, i + 6);
Haven't we just validated that `record->operand_count` is not smaller than `i + 6`? So this `min()` is always `i + 6`.