Add missing ensureCapacity call in codegen

master
Jakub Konka 2020-10-01 19:59:05 +02:00
parent f8dd48bcd2
commit 2ba23abd9d
1 changed files with 1 additions and 0 deletions

View File

@ -1537,6 +1537,7 @@ fn Function(comptime arch: std.Target.Cpu.Arch) type {
// movabsq [addr], %rax
try self.genSetReg(inst.base.src, .rax, .{ .memory = got_addr });
// callq *%rax
try self.code.ensureCapacity(self.code.items.len + 2);
self.code.appendSliceAssumeCapacity(&[2]u8{ 0xff, 0xd0 });
} else {
return self.fail(inst.base.src, "TODO implement calling bitcasted functions", .{});