aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVeikka Tuominen <git@vexu.eu>2022-05-31 16:21:36 +0300
committerVeikka Tuominen <git@vexu.eu>2022-05-31 16:22:00 +0300
commitfebc7d3cd63eefe91c7aaa95e3a274a0b44e353e (patch)
tree67ef6d579402767c8c359fabd98f11026a03eac0 /src
parent83beed09e1ce5a15e2b9801a50cf601352d8383e (diff)
downloadzig-febc7d3cd63eefe91c7aaa95e3a274a0b44e353e.tar.gz
zig-febc7d3cd63eefe91c7aaa95e3a274a0b44e353e.zip
Sema: take `dbg_stmt` into account in `zirResolveInferredAlloc`
Diffstat (limited to 'src')
-rw-r--r--src/Sema.zig2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Sema.zig b/src/Sema.zig
index 505810a158..ed8391a44d 100644
--- a/src/Sema.zig
+++ b/src/Sema.zig
@@ -2976,7 +2976,7 @@ fn zirResolveInferredAlloc(sema: *Sema, block: *Block, inst: Zir.Inst.Index) Com
// Even though we reuse the constant instruction, we still remove it from the
// block so that codegen does not see it.
- block.instructions.shrinkRetainingCapacity(block.instructions.items.len - 3);
+ block.instructions.shrinkRetainingCapacity(search_index);
sema.air_values.items[value_index] = try Value.Tag.decl_ref.create(sema.arena, new_decl_index);
// if bitcast ty ref needs to be made const, make_ptr_const
// ZIR handles it later, so we can just use the ty ref here.