fix incorrect usage of type byte size for eval memory range sizes

This commit is contained in:
Ryan Fleury
2025-05-05 10:49:52 -07:00
parent 573a6b0bb2
commit cf33470cb1
+6 -4
View File
@@ -1225,14 +1225,16 @@ e_range_size_from_eval(E_Eval eval)
U64 result = 256;
E_TypeKey type_unwrapped = e_type_key_unwrap(eval.irtree.type_key, E_TypeUnwrapFlag_AllDecorative);
E_TypeKind type_unwrapped_kind = e_type_kind_from_key(type_unwrapped);
if(e_type_kind_is_pointer_or_ref(type_unwrapped_kind) ||
type_unwrapped_kind == E_TypeKind_Function)
if(type_unwrapped_kind == E_TypeKind_Array ||
type_unwrapped_kind == E_TypeKind_Struct ||
type_unwrapped_kind == E_TypeKind_Union ||
type_unwrapped_kind == E_TypeKind_Class)
{
result = KB(16);
result = e_type_byte_size_from_key(type_unwrapped);
}
else
{
result = e_type_byte_size_from_key(type_unwrapped);
result = KB(16);
}
return result;
}