summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMax Moroz <mmoroz@chromium.org>2018-07-13 22:49:06 +0000
committerMax Moroz <mmoroz@chromium.org>2018-07-13 22:49:06 +0000
commitbea00ccdf28bfd0f2773a09b0e429f7f6b54c0c9 (patch)
tree250281feca633a6627607290dc99e2e25806f24e /lib
parent3b0b1758204f24c622fc59812e4dba2813dfa19d (diff)
[UBSan] Followup for silence_unsigned_overflow flag to handle negate overflows.
Summary: That flag has been introduced in https://reviews.llvm.org/D48660 for suppressing UIO error messages in an efficient way. The main motivation is to be able to use UIO checks in builds used for fuzzing as it might provide an interesting signal to a fuzzing engine such as libFuzzer. See https://github.com/google/oss-fuzz/issues/910 for more information. Reviewers: morehouse, kcc Reviewed By: morehouse Subscribers: kubamracek, delcypher, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D49324 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@337068 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/ubsan/ubsan_handlers.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/ubsan/ubsan_handlers.cc b/lib/ubsan/ubsan_handlers.cc
index b48862a9d..49c6bcacb 100644
--- a/lib/ubsan/ubsan_handlers.cc
+++ b/lib/ubsan/ubsan_handlers.cc
@@ -156,6 +156,9 @@ static void handleNegateOverflowImpl(OverflowData *Data, ValueHandle OldVal,
if (ignoreReport(Loc, Opts, ET))
return;
+ if (!IsSigned && flags()->silence_unsigned_overflow)
+ return;
+
ScopedReport R(Opts, Loc, ET);
if (IsSigned)