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:
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user