Fix a race condition when produced anonymous procedure literals with -use-separate-modules

This commit is contained in:
gingerBill
2023-06-13 13:14:59 +01:00
parent 296674e18b
commit 581eebb197
5 changed files with 99 additions and 55 deletions

View File

@@ -473,6 +473,7 @@ gb_internal lbValue lb_const_value(lbModule *m, Type *type, ExactValue value, bo
if (value.kind == ExactValue_Procedure) {
lbValue res = {};
Ast *expr = unparen_expr(value.value_procedure);
GB_ASSERT(expr != nullptr);
if (expr->kind == Ast_ProcLit) {
res = lb_generate_anonymous_proc_lit(m, str_lit("_proclit"), expr);
} else {