diff options
| author | Ginger Bill <bill@gingerbill.org> | 2017-08-13 22:09:26 +0100 |
|---|---|---|
| committer | Ginger Bill <bill@gingerbill.org> | 2017-08-13 22:09:26 +0100 |
| commit | 01519f2fd5dc7551291c2e54d5e9b1d4c97df92f (patch) | |
| tree | 1fa5174e72a9caffeaa4e59fbb58b026057861f6 /src/ir.cpp | |
| parent | 33aad3a8cec6aec8b6041c20ee661b4b8a451333 (diff) | |
Fix `push_allocator`
Diffstat (limited to 'src/ir.cpp')
| -rw-r--r-- | src/ir.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/ir.cpp b/src/ir.cpp index 93888588f..c777280bd 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -7065,7 +7065,9 @@ void ir_build_stmt_internal(irProcedure *proc, AstNode *node) { array_add(&proc->context_stack, next); defer (array_pop(&proc->context_stack)); - irValue *gep = ir_emit_struct_ep(proc, next, 1); + // TODO(bill): is this too leaky? + Selection sel = lookup_field(proc->module->allocator, t_context, str_lit("allocator"), false); + irValue *gep = ir_emit_deep_field_gep(proc, next, sel); ir_emit_store(proc, gep, ir_build_expr(proc, pa->expr)); ir_build_stmt(proc, pa->body); |