mirror of
https://github.com/ziglang/zig.git
synced 2026-02-15 05:48:31 +00:00
fix calculation in ensureCapacity
This commit is contained in:
parent
f3770dcc30
commit
240b15381d
@ -2531,7 +2531,8 @@ fn astgenAndSemaFn(
|
||||
// `extra` so that we have access to the data in codegen, for debug info.
|
||||
const str_index = @intCast(u32, wip_zir_code.string_bytes.items.len);
|
||||
wip_zir_code.extra.appendAssumeCapacity(str_index);
|
||||
try wip_zir_code.string_bytes.ensureCapacity(mod.gpa, param_name.len + 1);
|
||||
const used_bytes = wip_zir_code.string_bytes.items.len;
|
||||
try wip_zir_code.string_bytes.ensureCapacity(mod.gpa, used_bytes + param_name.len + 1);
|
||||
wip_zir_code.string_bytes.appendSliceAssumeCapacity(param_name);
|
||||
wip_zir_code.string_bytes.appendAssumeCapacity(0);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user