[compiler-rt] r282102 - [asan] Store full AddressDescription objects in ErrorInvalidPointerPair
Filipe Cabecinhas via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 21 12:21:01 PDT 2016
Author: filcab
Date: Wed Sep 21 14:21:01 2016
New Revision: 282102
URL: http://llvm.org/viewvc/llvm-project?rev=282102&view=rev
Log:
[asan] Store full AddressDescription objects in ErrorInvalidPointerPair
Reviewers: kcc, vitalybuka, eugenis
Subscribers: kubabrecka, llvm-commits
Differential Revision: https://reviews.llvm.org/D24777
Modified:
compiler-rt/trunk/lib/asan/asan_errors.cc
compiler-rt/trunk/lib/asan/asan_errors.h
Modified: compiler-rt/trunk/lib/asan/asan_errors.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_errors.cc?rev=282102&r1=282101&r2=282102&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_errors.cc (original)
+++ compiler-rt/trunk/lib/asan/asan_errors.cc Wed Sep 21 14:21:01 2016
@@ -271,12 +271,13 @@ void ErrorInvalidPointerPair::Print() {
const char *bug_type = "invalid-pointer-pair";
Decorator d;
Printf("%s", d.Warning());
- Report("ERROR: AddressSanitizer: invalid-pointer-pair: %p %p\n", p1, p2);
+ Report("ERROR: AddressSanitizer: invalid-pointer-pair: %p %p\n",
+ addr1_description.Address(), addr2_description.Address());
Printf("%s", d.EndWarning());
GET_STACK_TRACE_FATAL(pc, bp);
stack.Print();
- PrintAddressDescription(p1, 1, bug_type);
- PrintAddressDescription(p2, 1, bug_type);
+ addr1_description.Print();
+ addr2_description.Print();
ReportErrorSummary(bug_type, &stack);
}
Modified: compiler-rt/trunk/lib/asan/asan_errors.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_errors.h?rev=282102&r1=282101&r2=282102&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_errors.h (original)
+++ compiler-rt/trunk/lib/asan/asan_errors.h Wed Sep 21 14:21:01 2016
@@ -279,13 +279,20 @@ struct ErrorODRViolation : ErrorBase {
};
struct ErrorInvalidPointerPair : ErrorBase {
- uptr pc, bp, sp, p1, p2;
+ uptr pc, bp, sp;
+ AddressDescription addr1_description;
+ AddressDescription addr2_description;
// VS2013 doesn't implement unrestricted unions, so we need a trivial default
// constructor
ErrorInvalidPointerPair() = default;
- ErrorInvalidPointerPair(u32 tid, uptr pc_, uptr bp_, uptr sp_, uptr p1_,
- uptr p2_)
- : ErrorBase(tid), pc(pc_), bp(bp_), sp(sp_), p1(p1_), p2(p2_) {}
+ ErrorInvalidPointerPair(u32 tid, uptr pc_, uptr bp_, uptr sp_, uptr p1,
+ uptr p2)
+ : ErrorBase(tid),
+ pc(pc_),
+ bp(bp_),
+ sp(sp_),
+ addr1_description(p1, 1, /*shouldLockThreadRegistry=*/false),
+ addr2_description(p2, 1, /*shouldLockThreadRegistry=*/false) {}
void Print();
};
More information about the llvm-commits
mailing list