diff options
| author | Filipe Cabecinhas <me@filcab.net> | 2016-09-13 20:47:37 +0000 |
|---|---|---|
| committer | Filipe Cabecinhas <me@filcab.net> | 2016-09-13 20:47:37 +0000 |
| commit | 5f862c20cbd504914533e1d51915372560f54511 (patch) | |
| tree | e2172d105034b88ef882460f55877d8a658ab523 /compiler-rt/lib/asan/asan_errors.cc | |
| parent | 92c5b5de5c4bb7febf6c6ed6321dbff869d58c40 (diff) | |
| download | bcm5719-llvm-5f862c20cbd504914533e1d51915372560f54511.tar.gz bcm5719-llvm-5f862c20cbd504914533e1d51915372560f54511.zip | |
[asan] Reify ErrorMallocUsableSizeNotOwned
Summary: Continuing implementation mentioned in this thread: http://lists.llvm.org/pipermail/llvm-dev/2016-July/101933.html
Reviewers: kcc, eugenis, vitalybuka
Subscribers: llvm-commits, kubabrecka
Differential Revision: https://reviews.llvm.org/D24391
llvm-svn: 281391
Diffstat (limited to 'compiler-rt/lib/asan/asan_errors.cc')
| -rw-r--r-- | compiler-rt/lib/asan/asan_errors.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/compiler-rt/lib/asan/asan_errors.cc b/compiler-rt/lib/asan/asan_errors.cc index d35c228abd5..6aeb5083a36 100644 --- a/compiler-rt/lib/asan/asan_errors.cc +++ b/compiler-rt/lib/asan/asan_errors.cc @@ -164,4 +164,17 @@ void ErrorAllocTypeMismatch::Print() { "ASAN_OPTIONS=alloc_dealloc_mismatch=0\n"); } +void ErrorMallocUsableSizeNotOwned::Print() { + Decorator d; + Printf("%s", d.Warning()); + Report( + "ERROR: AddressSanitizer: attempting to call malloc_usable_size() for " + "pointer which is not owned: %p\n", + addr_description.Address()); + Printf("%s", d.EndWarning()); + stack->Print(); + addr_description.Print(); + ReportErrorSummary("bad-malloc_usable_size", stack); +} + } // namespace __asan |

