Allow casts to change mode for array programming

This commit is contained in:
misomosi
2026-07-01 07:59:08 -04:00
parent e276ce552b
commit a2a0b83162

View File

@@ -3926,6 +3926,11 @@ gb_internal void check_cast(CheckerContext *c, Operand *x, Type *type, bool forb
}
}
// In this case, the cast involves array programming
// so the operand needs to be a computed value
if (!is_type_array_like(x->type) && is_type_array_like(type)) {
x->mode = Addressing_Value;
}
x->type = type;
}