From 4dc50151c4593d289ed903d8177f11d724e3ade0 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Thu, 21 Mar 2024 15:01:57 -0700 Subject: [PATCH] std.mem.indexOfSentinel: valgrind integration this code returns false positives in Valgrind, so we fall back to the other implementation when running in valgrind. see #17717 --- lib/std/mem.zig | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/std/mem.zig b/lib/std/mem.zig index 3f24091946..1ea67d2cce 100644 --- a/lib/std/mem.zig +++ b/lib/std/mem.zig @@ -1038,6 +1038,7 @@ pub fn indexOfSentinel(comptime T: type, comptime sentinel: T, p: [*:sentinel]co var i: usize = 0; 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))) {