diff options
Diffstat (limited to 'base')
-rw-r--r-- | base/tools_sanity_unittest.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/base/tools_sanity_unittest.cc b/base/tools_sanity_unittest.cc index 661b58e..bbcb3e5 100644 --- a/base/tools_sanity_unittest.cc +++ b/base/tools_sanity_unittest.cc @@ -15,7 +15,10 @@ namespace { const base::subtle::Atomic32 kMagicValue = 42; void ReadUninitializedValue(char *ptr) { - if (*ptr == '\0') { + // The || in the conditional is to prevent clang from optimizing away the + // jump -- valgrind only catches jumps and conditional moves, but clang uses + // the borrow flag if the condition is just `*ptr == '\0'`. + if (*ptr == '\0' || *ptr == 64) { (*ptr)++; } else { (*ptr)--; |