diff options
| author | Kostya Serebryany <kcc@google.com> | 2016-02-04 02:02:09 +0000 |
|---|---|---|
| committer | Kostya Serebryany <kcc@google.com> | 2016-02-04 02:02:09 +0000 |
| commit | 2b9be250660eaf563fc9a3520363b7f19569daf1 (patch) | |
| tree | cdbbf1887c8640137ed1518636cb4788d351c060 /compiler-rt/lib/sanitizer_common/sanitizer_posix.cc | |
| parent | 155402c9c23b12fcbb49d31bc7e238ecd88c999e (diff) | |
| download | bcm5719-llvm-2b9be250660eaf563fc9a3520363b7f19569daf1.tar.gz bcm5719-llvm-2b9be250660eaf563fc9a3520363b7f19569daf1.zip | |
[asan] When catching a signal caused by a memory access, print if it's a READ or a WRITE. This touches win/mac files which I have not tested, if a win/mac bot fails I'll try to quick-fix
llvm-svn: 259741
Diffstat (limited to 'compiler-rt/lib/sanitizer_common/sanitizer_posix.cc')
| -rw-r--r-- | compiler-rt/lib/sanitizer_common/sanitizer_posix.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_posix.cc b/compiler-rt/lib/sanitizer_common/sanitizer_posix.cc index e677e33c660..e8e9017033f 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_posix.cc +++ b/compiler-rt/lib/sanitizer_common/sanitizer_posix.cc @@ -323,10 +323,13 @@ bool GetCodeRangeForFile(const char *module, uptr *start, uptr *end) { } SignalContext SignalContext::Create(void *siginfo, void *context) { - uptr addr = (uptr)((siginfo_t*)siginfo)->si_addr; + auto si = (siginfo_t*)siginfo; + uptr addr = (uptr)si->si_addr; uptr pc, sp, bp; GetPcSpBp(context, &pc, &sp, &bp); - return SignalContext(context, addr, pc, sp, bp); + bool is_write = GetSigContextWriteFlag(context); + bool is_memory_access = si->si_signo == SIGSEGV; + return SignalContext(context, addr, pc, sp, bp, is_memory_access, is_write); } } // namespace __sanitizer |

