mirror of
https://github.com/ziglang/zig.git
synced 2026-02-13 04:48:20 +00:00
Value: fix out-of-bounds slice access writing zero-bit undef value
I have no idea why this wasn't being hit on master before.
This commit is contained in:
parent
03ad862197
commit
3c45a94528
@ -469,7 +469,9 @@ pub fn writeToPackedMemory(
|
||||
const endian = target.cpu.arch.endian();
|
||||
if (val.isUndef(mod)) {
|
||||
const bit_size: usize = @intCast(ty.bitSize(mod));
|
||||
std.mem.writeVarPackedInt(buffer, bit_offset, bit_size, @as(u1, 0), endian);
|
||||
if (bit_size != 0) {
|
||||
std.mem.writeVarPackedInt(buffer, bit_offset, bit_size, @as(u1, 0), endian);
|
||||
}
|
||||
return;
|
||||
}
|
||||
switch (ty.zigTypeTag(mod)) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user