x86_64: fix miscompilations

Closes #17618
This commit is contained in:
Jacob Young
2023-11-03 12:12:36 -04:00
parent 6553359f39
commit 095c4294aa
2 changed files with 102 additions and 29 deletions

View File

@@ -106,7 +106,7 @@ pub fn MultiArrayList(comptime T: type) type {
}
pub fn toMultiArrayList(self: Slice) Self {
if (self.ptrs.len == 0) {
if (self.ptrs.len == 0 or self.capacity == 0) {
return .{};
}
const unaligned_ptr = self.ptrs[sizes.fields[0]];