apply integer truncation operations on both sign/size changes, rather than just size

This commit is contained in:
Ryan Fleury
2025-07-23 14:31:51 -07:00
parent 8d1de1b24c
commit cd64d959ef
+1 -1
View File
@@ -873,7 +873,7 @@ e_push_irtree_and_type_from_expr(Arena *arena, E_IRTreeAndType *root_parent, E_I
{
new_tree = e_irtree_convert_lo(arena, in_tree, out_group, in_group);
}
if(cast_type_byte_size < casted_type_byte_size && e_type_kind_is_integer(cast_type_kind))
if(cast_type_kind != casted_type_kind && e_type_kind_is_integer(cast_type_kind))
{
new_tree = e_irtree_trunc(arena, in_tree, cast_type);
}