Smith.Weight: do not use of indexOfScalar

In larger fuzz tests this can cause the eval branch quota to be
exceeded.
This commit is contained in:
Kendall Condon
2026-03-11 21:15:47 -04:00
parent c3e6ff7206
commit bca057afd2
+6 -3
View File
@@ -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));
}
}