From 4d5a442d1f7d896e6628b68c0f03b07fa5239475 Mon Sep 17 00:00:00 2001 From: "J.C. Moyer" Date: Sun, 21 May 2023 16:43:34 -0400 Subject: Use compound literal storage for ValueDecl lvals Prior to this commit, if a variable was initialized using a compound literal, its associated storage would not be set. This commit makes the variable always take on the storage of the compound literal. Fixes #2466 --- src/llvm_backend_stmt.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/llvm_backend_stmt.cpp') diff --git a/src/llvm_backend_stmt.cpp b/src/llvm_backend_stmt.cpp index 125913ac5..0d6f8a136 100644 --- a/src/llvm_backend_stmt.cpp +++ b/src/llvm_backend_stmt.cpp @@ -2303,6 +2303,7 @@ gb_internal void lb_build_stmt(lbProcedure *p, Ast *node) { lb_add_entity(p->module, e, val); lb_add_debug_local_variable(p, val.value, e->type, e->token); lvals_preused[lval_index] = true; + lvals[lval_index] = *comp_lit_addr; } } } -- cgit v1.2.3