Skip to content

Commit e40e0cc

Browse files
candrewlee14andrewrk
authored andcommitted
add workaround for ziglang#13782
1 parent 40cb70c commit e40e0cc

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

lib/std/hash_map.zig

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -828,7 +828,10 @@ pub fn HashMapUnmanaged(
828828

829829
const cap = it.hm.capacity();
830830
var metadata = it.hm.metadata.? + it.index;
831-
if (builtin.zig_backend != .stage2_c) {
831+
if (comptime builtin.zig_backend != .stage2_c and // TODO
832+
// https://github.com/ziglang/zig/issues/13782
833+
(builtin.zig_backend != .stage2_llvm or builtin.cpu.arch.endian() != .Big))
834+
{
832835
comptime var vec_size: u8 = 16;
833836
inline while (vec_size >= 1) : (vec_size /= 2) {
834837
while ((cap - it.index) >= vec_size) {
@@ -881,7 +884,10 @@ pub fn HashMapUnmanaged(
881884
items: [*]T,
882885

883886
pub fn next(self: *@This()) ?*T {
884-
if (builtin.zig_backend != .stage2_c) {
887+
if (comptime builtin.zig_backend != .stage2_c and // TODO
888+
// https://github.com/ziglang/zig/issues/13782
889+
(builtin.zig_backend != .stage2_llvm or builtin.cpu.arch.endian() != .Big))
890+
{
885891
comptime var vec_size: usize = 16;
886892
inline while (vec_size >= 1) : (vec_size /= 2) {
887893
while (self.len >= vec_size) {

0 commit comments

Comments
 (0)