commit cd149c7317d554f17687c89bab6d3e5e50e6e935
parent cd44b50d2970bebc50d2a3339619f9ccb3ae63e0
Author: Eyal Sawady <ecs@d2evs.net>
Date: Tue, 5 Apr 2022 23:01:53 +0000
check: fix unhinted copy allocation
Signed-off-by: Eyal Sawady <ecs@d2evs.net>
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/check.c b/src/check.c
@@ -372,7 +372,7 @@ check_expr_alloc_copy(struct context *ctx,
check_expression(ctx, aexpr->alloc.init, expr->alloc.init, hint);
const struct type *result = expr->alloc.init->result;
- if (result != hint) {
+ if (hint && result != hint) {
// TODO: We might be able to be less strict on this. We could
// copy slices of types which differ only based on the flag, or
// copy an array into a new slice.