aboutsummaryrefslogtreecommitdiff
path: root/src/codegen
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2021-05-15 21:00:15 -0700
committerAndrew Kelley <andrew@ziglang.org>2021-05-15 21:00:15 -0700
commitdc036f5b6fde67c4a74701c75c5947a956abaec1 (patch)
tree149d62133f77763a194685b5793f764619707df7 /src/codegen
parent5769ed2d4428305e4478cf4e425f5df2469a7ffd (diff)
downloadzig-dc036f5b6fde67c4a74701c75c5947a956abaec1.tar.gz
zig-dc036f5b6fde67c4a74701c75c5947a956abaec1.zip
codegen: implement const value rendering for ints <= 64 bits
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 };
}