| ... | ... | @@ -543,13 +543,10 @@ fn Function(comptime arch: std.Target.Cpu.Arch) type { |
| 543 | 543 | if (self.code.items.len >= math.maxInt(i32)) { |
| 544 | 544 | return self.fail(self.src, "unable to perform relocation: jump too far", .{}); |
| 545 | 545 | } |
| 546 | | for (self.exitlude_jump_relocs.items) |jmp_reloc| { |
| 546 | if (self.exitlude_jump_relocs.items.len == 1) { |
| 547 | self.code.items.len -= 5; |
| 548 | } else for (self.exitlude_jump_relocs.items) |jmp_reloc| { |
| 547 | 549 | const amt = self.code.items.len - (jmp_reloc + 4); |
| 548 | | // If it wouldn't jump at all, elide it. |
| 549 | | if (amt == 0) { |
| 550 | | self.code.items.len -= 5; |
| 551 | | continue; |
| 552 | | } |
| 553 | 550 | const s32_amt = @intCast(i32, amt); |
| 554 | 551 | mem.writeIntLittle(i32, self.code.items[jmp_reloc..][0..4], s32_amt); |
| 555 | 552 | } |