diff options
| author | J.C. Moyer <jcmoyer32@gmail.com> | 2023-05-21 16:43:34 -0400 |
|---|---|---|
| committer | J.C. Moyer <jcmoyer32@gmail.com> | 2023-05-21 16:43:34 -0400 |
| commit | 4d5a442d1f7d896e6628b68c0f03b07fa5239475 (patch) | |
| tree | 2e2ebb7bfd27c98be06c96533862aea52ea9ac7b /src | |
| parent | 249f42f05455fb71bd0b5e4acee445991a988699 (diff) | |
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
Diffstat (limited to 'src')
| -rw-r--r-- | src/llvm_backend_stmt.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
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; } } } |