mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-04-13 05:43:18 -07:00
vkd3d-shader: Avoid left shifting signed integers. (ubsan)
Otherwise ubsan reports these errors on the bitwise.shader_test: libs/vkd3d-shader/hlsl_constant_ops.c:970:50: runtime error: left shift of 1 by 31 places cannot be represented in type 'int' libs/vkd3d-shader/hlsl_constant_ops.c:970:50: runtime error: left shift of negative value -12
This commit is contained in:
committed by
Henri Verbeet
parent
8056058aa1
commit
9b3b47b1b8
Notes:
Henri Verbeet
2025-01-10 20:15:12 +01:00
Approved-by: Elizabeth Figura (@zfigura) Approved-by: Henri Verbeet (@hverbeet) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1327
@ -952,9 +952,6 @@ static bool fold_lshift(struct hlsl_ctx *ctx, struct hlsl_constant_value *dst, c
|
||||
switch (src1->node.data_type->e.numeric.type)
|
||||
{
|
||||
case HLSL_TYPE_INT:
|
||||
dst->u[k].i = src1->value.u[k].i << shift;
|
||||
break;
|
||||
|
||||
case HLSL_TYPE_UINT:
|
||||
dst->u[k].u = src1->value.u[k].u << shift;
|
||||
break;
|
||||
|
Reference in New Issue
Block a user