authorgravatar for goon.pri.low@gmail.comKendall Condon <goon.pri.low@gmail.com> 2026-03-11 21:15:47-04:00
committergravatar for goon.pri.low@gmail.comKendall Condon <goon.pri.low@gmail.com> 2026-03-11 21:16:52-04:00
logbca057afd28bdcc38b123c05915ca7d775a2a17d
treede6bbcdf54358c71ee90ebbd448f930469333580
parentc3e6ff7206c4e406bef8696171b40666ccd228b8

Smith.Weight: do not use of indexOfScalar

In larger fuzz tests this can cause the eval branch quota to be exceeded.

1 files changed, 6 insertions(+), 3 deletions(-)

lib/std/Build/abi.zig+6-3
...@@ -250,9 +250,12 @@ pub const fuzz = struct {...@@ -250,9 +250,12 @@ pub const fuzz = struct {
250 }250 }
251 // Reject types that don't have a fixed bitsize (esp. usize)251 // Reject types that don't have a fixed bitsize (esp. usize)
252 // since they are not gauraunteed to fit in a u64 across targets.252 // since they are not gauraunteed to fit in a u64 across targets.
253 if (std.mem.indexOfScalar(type, &.{253 //
254 usize, c_char, c_ushort, c_uint, c_ulong, c_ulonglong,254 // std.mem.indexOfScalar is not used to avoid backward branches
255 }, T) != null) {255 // and preserve the eval branch quota.
256 if (T == usize or T == c_char or T == c_ushort or
257 T == c_uint or T == c_ulong or T == c_ulonglong)
258 {
256 @compileError("type does not have a fixed bitsize: " ++ @typeName(T));259 @compileError("type does not have a fixed bitsize: " ++ @typeName(T));
257 }260 }
258 }261 }