From bca057afd28bdcc38b123c05915ca7d775a2a17d Mon Sep 17 00:00:00 2001 From: Kendall Condon Date: Wed, 11 Mar 2026 21:15:47 -0400 Subject: [PATCH] Smith.Weight: do not use of indexOfScalar In larger fuzz tests this can cause the eval branch quota to be exceeded. --- lib/std/Build/abi.zig | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/std/Build/abi.zig b/lib/std/Build/abi.zig index 0baad7f19f..28f455d73f 100644 --- a/lib/std/Build/abi.zig +++ b/lib/std/Build/abi.zig @@ -250,9 +250,12 @@ pub const fuzz = struct { } // Reject types that don't have a fixed bitsize (esp. usize) // since they are not gauraunteed to fit in a u64 across targets. - if (std.mem.indexOfScalar(type, &.{ - usize, c_char, c_ushort, c_uint, c_ulong, c_ulonglong, - }, T) != null) { + // + // std.mem.indexOfScalar is not used to avoid backward branches + // and preserve the eval branch quota. + if (T == usize or T == c_char or T == c_ushort or + T == c_uint or T == c_ulong or T == c_ulonglong) + { @compileError("type does not have a fixed bitsize: " ++ @typeName(T)); } }