summaryrefslogtreecommitdiff
path: root/lib/asan/asan_errors.h
diff options
context:
space:
mode:
authorKuba Mracek <mracek@apple.com>2016-11-28 21:18:15 +0000
committerKuba Mracek <mracek@apple.com>2016-11-28 21:18:15 +0000
commitb90241cb40aa65e86384218f544dfabca62f35cf (patch)
treecd219adf3c514725e3bbeabc5bca89f5167bde13 /lib/asan/asan_errors.h
parent870051aae2966d277f5c3e061a93264506eee6f4 (diff)
downloadcompiler-rt-b90241cb40aa65e86384218f544dfabca62f35cf.tar.gz
[asan] Provide bug descriptions for all reports (not just ErrorGeneric)
Differential Revision: https://reviews.llvm.org/D27012 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@288065 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/asan/asan_errors.h')
-rw-r--r--lib/asan/asan_errors.h18
1 files changed, 15 insertions, 3 deletions
diff --git a/lib/asan/asan_errors.h b/lib/asan/asan_errors.h
index cfd58abce..9a1249244 100644
--- a/lib/asan/asan_errors.h
+++ b/lib/asan/asan_errors.h
@@ -172,6 +172,7 @@ struct ErrorMallocUsableSizeNotOwned : ErrorBase {
stack(stack_),
addr_description(addr, /*shouldLockThreadRegistry=*/false) {
scariness.Clear();
+ scariness.Scare(10, "bad-malloc_usable_size");
}
void Print();
};
@@ -189,6 +190,7 @@ struct ErrorSanitizerGetAllocatedSizeNotOwned : ErrorBase {
stack(stack_),
addr_description(addr, /*shouldLockThreadRegistry=*/false) {
scariness.Clear();
+ scariness.Scare(10, "bad-__sanitizer_get_allocated_size");
}
void Print();
};
@@ -258,7 +260,10 @@ struct ErrorBadParamsToAnnotateContiguousContainer : ErrorBase {
beg(beg_),
end(end_),
old_mid(old_mid_),
- new_mid(new_mid_) {}
+ new_mid(new_mid_) {
+ scariness.Clear();
+ scariness.Scare(10, "bad-__sanitizer_annotate_contiguous_container");
+ }
void Print();
};
@@ -274,7 +279,10 @@ struct ErrorODRViolation : ErrorBase {
global1(*g1),
global2(*g2),
stack_id1(stack_id1_),
- stack_id2(stack_id2_) {}
+ stack_id2(stack_id2_) {
+ scariness.Clear();
+ scariness.Scare(10, "odr-violation");
+ }
void Print();
};
@@ -292,7 +300,10 @@ struct ErrorInvalidPointerPair : ErrorBase {
bp(bp_),
sp(sp_),
addr1_description(p1, 1, /*shouldLockThreadRegistry=*/false),
- addr2_description(p2, 1, /*shouldLockThreadRegistry=*/false) {}
+ addr2_description(p2, 1, /*shouldLockThreadRegistry=*/false) {
+ scariness.Clear();
+ scariness.Scare(10, "invalid-pointer-pair");
+ }
void Print();
};
@@ -350,6 +361,7 @@ struct ErrorDescription {
// We can add a wrapper around it to make it "more c++-like", but that would
// add a lot of code and the benefit wouldn't be that big.
union {
+ ErrorBase Base;
ASAN_FOR_EACH_ERROR_KIND(ASAN_ERROR_DESCRIPTION_MEMBER)
};