fix #7596 and #7511: proc literal as union variant in compound literal crashes backend

This commit is contained in:
Fernando Nunes committed 2026-09-25 07:08:01 -03:00
1 parent f1fd03364d
commit bc68304497
4 files changed
+29 -1

No files matched your search

+3 -1
View File
@@ -9527,7 +9527,9 @@ gb_internal bool check_is_operand_compound_lit_constant(CheckerContext *c, Opera
return true;
}
if (expr->kind == Ast_ProcLit) {
add_type_and_value(c, expr, Addressing_Constant, type_of_expr(expr), exact_value_procedure(expr));
ExactValue value = exact_value_procedure(expr);
value.variant_type = o->value.variant_type;
add_type_and_value(c, expr, Addressing_Constant, type_of_expr(expr), value);
return true;
}