aboutsummaryrefslogtreecommitdiff
path: root/src/codegen
diff options
context:
space:
mode:
Diffstat (limited to 'src/codegen')
-rw-r--r--src/codegen/x86_64.zig2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/codegen/x86_64.zig b/src/codegen/x86_64.zig
index 5a09f48e17..0e1ffefe75 100644
--- a/src/codegen/x86_64.zig
+++ b/src/codegen/x86_64.zig
@@ -171,7 +171,7 @@ pub const Encoder = struct {
/// This is because the helper functions will assume capacity
/// in order to avoid bounds checking.
pub fn init(code: *ArrayList(u8), maximum_inst_size: u8) !Self {
- try code.ensureCapacity(code.items.len + maximum_inst_size);
+ try code.ensureUnusedCapacity(maximum_inst_size);
return Self{ .code = code };
}