Skip to content

Commit a856b74

Browse files
committed
Require verbosity >= 1
1 parent be37467 commit a856b74

File tree

2 files changed

+16
-14
lines changed

2 files changed

+16
-14
lines changed

compiler-rt/lib/msan/msan.cpp

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -372,18 +372,19 @@ static void print_shadow_value(void *shadow, u64 size) {
372372
Printf("\n");
373373
}
374374

375-
#define MSAN_MAYBE_WARNING(type, size) \
376-
void __msan_maybe_warning_##size(type s, u32 o) { \
377-
GET_CALLER_PC_BP; \
378-
\
379-
if (UNLIKELY(s)) { \
380-
PrintWarningWithOrigin(pc, bp, o); \
381-
print_shadow_value((void *)(&s), sizeof(s)); \
382-
if (__msan::flags()->halt_on_error) { \
383-
Printf("Exiting\n"); \
384-
Die(); \
385-
} \
386-
} \
375+
#define MSAN_MAYBE_WARNING(type, size) \
376+
void __msan_maybe_warning_##size(type s, u32 o) { \
377+
GET_CALLER_PC_BP; \
378+
\
379+
if (UNLIKELY(s)) { \
380+
PrintWarningWithOrigin(pc, bp, o); \
381+
if (Verbosity() >= 1) \
382+
print_shadow_value((void *)(&s), sizeof(s)); \
383+
if (__msan::flags()->halt_on_error) { \
384+
Printf("Exiting\n"); \
385+
Die(); \
386+
} \
387+
} \
387388
}
388389

389390
MSAN_MAYBE_WARNING(u8, 1)
@@ -406,7 +407,8 @@ void __msan_maybe_warning_N(void *shadow, u64 size, u32 o) {
406407

407408
if (UNLIKELY(!allZero)) {
408409
PrintWarningWithOrigin(pc, bp, o);
409-
print_shadow_value(shadow, size);
410+
if (Verbosity() >= 1)
411+
print_shadow_value(shadow, size);
410412
if (__msan::flags()->halt_on_error) {
411413
Printf("Exiting\n");
412414
Die();

compiler-rt/test/msan/msan_print_shadow_on_outlined_check.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: %clangxx_msan -fsanitize-recover=memory -mllvm -msan-instrumentation-with-call-threshold=0 -g %s -o %t \
2-
// RUN: && not %run %t 2>&1 | FileCheck %s
2+
// RUN: && not env MSAN_OPTIONS=verbosity=1 %run %t 2>&1 | FileCheck %s
33

44
#include <ctype.h>
55
#include <stdio.h>

0 commit comments

Comments
 (0)