Giovanni Mascellani (@giomasce) commented about libs/vkd3d-shader/hlsl.c:
var->storage_modifiers = modifiers; if (reg_reservation) var->reg_reservation = *reg_reservation;
- for (k = 0; k <= HLSL_REGSET_LAST_OBJECT; ++k)
- {
unsigned int i, obj_count = type->reg_size[k];
if (obj_count == 0)
continue;
if (!(var->objects_usage[k] = hlsl_alloc(ctx, sizeof(*var->objects_usage[0]) * obj_count)))
That's a bit funny, because we have `hlsl_alloc()` as a wrapper over `vkd3d_calloc()` which is a wrapper over `calloc()`. Both `calloc()` and `vkd3d_calloc()` check for multiplication overflow, but this is lost due to `hlsl_alloc()`. I am not sure we have a consistent policy of being careful about these things (though that wouldn't be a bad idea), so I don't think there is any hard need to change anything, but it's funny nevertheless.