aboutsummaryrefslogtreecommitdiff
path: root/lib/std
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2024-03-21 14:35:37 -0700
committerAndrew Kelley <andrew@ziglang.org>2024-03-21 14:35:37 -0700
commit33428fc6aaf40ac19051df3a6669561c84e9faf6 (patch)
tree8f8240a6ee4bdbba28ec0243f6649fc30b611f30 /lib/std
parentafa0834195c48418179d43430a052b2a23b50e00 (diff)
downloadzig-33428fc6aaf40ac19051df3a6669561c84e9faf6.tar.gz
zig-33428fc6aaf40ac19051df3a6669561c84e9faf6.zip
std.mem.indexOfScalarPos: valgrind integration
this code returns false positives in Valgrind, so we fall back to the other implementation when running in valgrind. see #17717
Diffstat (limited to 'lib/std')
-rw-r--r--lib/std/mem.zig1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/std/mem.zig b/lib/std/mem.zig
index eb39370346..3f24091946 100644
--- a/lib/std/mem.zig
+++ b/lib/std/mem.zig
@@ -1187,6 +1187,7 @@ pub fn indexOfScalarPos(comptime T: type, slice: []const T, start_index: usize,
var i: usize = start_index;
if (backend_supports_vectors and
+ !std.debug.inValgrind() and // https://github.com/ziglang/zig/issues/17717
!@inComptime() and
(@typeInfo(T) == .Int or @typeInfo(T) == .Float) and std.math.isPowerOfTwo(@bitSizeOf(T)))
{