stage2 x86_64: fix codegen ensureCapacity bug for function calls

Co-authored-by: joachimschmidt557 <joachim.schmidt557@outlook.com>
This commit is contained in:
gracefu 2021-04-11 22:34:23 +08:00
parent 62e755623f
commit 1e63e8d8b6
No known key found for this signature in database
GPG Key ID: 2B0D39CC4E035325

View File

@ -2424,6 +2424,7 @@ fn Function(comptime arch: std.Target.Cpu.Arch) type {
.x86_64 => {
try self.genSetReg(inst.base.src, Type.initTag(.u32), .rax, .{ .memory = got_addr });
// callq *%rax
try self.code.ensureCapacity(self.code.items.len + 2);
self.code.appendSliceAssumeCapacity(&[2]u8{ 0xff, 0xd0 });
},
.aarch64 => {