mirror of
https://github.com/ziglang/zig.git
synced 2026-02-14 13:30:45 +00:00
InternPool: Fix rare buffer overflow when initializing aggregate with sentinel
This commit is contained in:
parent
92458094c8
commit
01b48e9381
@ -5315,7 +5315,7 @@ pub fn get(ip: *InternPool, gpa: Allocator, key: Key) Allocator.Error!Index {
|
||||
|
||||
try ip.extra.ensureUnusedCapacity(
|
||||
gpa,
|
||||
@typeInfo(Tag.Aggregate).Struct.fields.len + @as(usize, @intCast(len_including_sentinel)),
|
||||
@typeInfo(Tag.Aggregate).Struct.fields.len + @as(usize, @intCast(len_including_sentinel + 1)),
|
||||
);
|
||||
ip.items.appendAssumeCapacity(.{
|
||||
.tag = .aggregate,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user