diff options
| author | kcbanner <kcbanner@gmail.com> | 2023-11-11 16:48:11 -0500 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2023-11-12 18:22:57 -0500 |
| commit | 53500a57684665e08a2e18e7a736aacfa6548062 (patch) | |
| tree | 4504dfb16ce7655307c72adce1f8a97704f8c331 /src/Sema.zig | |
| parent | 70d8baaec11ca370b73fce72d7f3dfce2277455b (diff) | |
| download | zig-53500a57684665e08a2e18e7a736aacfa6548062.tar.gz zig-53500a57684665e08a2e18e7a736aacfa6548062.zip | |
sema: fixup underflows during struct / ptr array init when using -fstrip
Diffstat (limited to 'src/Sema.zig')
| -rw-r--r-- | src/Sema.zig | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Sema.zig b/src/Sema.zig index 7823b3ae0f..fd90c80910 100644 --- a/src/Sema.zig +++ b/src/Sema.zig @@ -4814,7 +4814,7 @@ fn validateStructInit( // Possible performance enhancement: save the `block_index` between iterations // of the for loop. - var block_index = block.instructions.items.len - 1; + var block_index = block.instructions.items.len -| 1; while (block_index > 0) : (block_index -= 1) { const store_inst = block.instructions.items[block_index]; if (Air.indexToRef(store_inst) == field_ptr_ref) { @@ -5070,7 +5070,7 @@ fn zirValidatePtrArrayInit( // Possible performance enhancement: save the `block_index` between iterations // of the for loop. - var block_index = block.instructions.items.len - 1; + var block_index = block.instructions.items.len -| 1; while (block_index > 0) : (block_index -= 1) { const store_inst = block.instructions.items[block_index]; if (Air.indexToRef(store_inst) == elem_ptr_ref) { |
