diff options
| author | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2013-12-12 13:48:47 +0000 |
|---|---|---|
| committer | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2013-12-12 13:48:47 +0000 |
| commit | 86d8fb5ba12f5f2eeadb53b32f6763617dbdf8de (patch) | |
| tree | 4ad8018ac4ba0b8d8b1c191cbe64edaf3df3ea91 /compiler-rt/lib/msan/msan.cc | |
| parent | 6215685ab94e41fa9020e41a7dc14b33ed80bc29 (diff) | |
| download | bcm5719-llvm-86d8fb5ba12f5f2eeadb53b32f6763617dbdf8de.tar.gz bcm5719-llvm-86d8fb5ba12f5f2eeadb53b32f6763617dbdf8de.zip | |
[msan] Clean stack and TLS shadow on thread exit.
llvm-svn: 197156
Diffstat (limited to 'compiler-rt/lib/msan/msan.cc')
| -rw-r--r-- | compiler-rt/lib/msan/msan.cc | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/compiler-rt/lib/msan/msan.cc b/compiler-rt/lib/msan/msan.cc index ecc7cb82817..4f8f351f3f6 100644 --- a/compiler-rt/lib/msan/msan.cc +++ b/compiler-rt/lib/msan/msan.cc @@ -173,8 +173,9 @@ void GetStackTrace(StackTrace *stack, uptr max_s, uptr pc, uptr bp, SymbolizerScope sym_scope; return stack->Unwind(max_s, pc, bp, 0, 0, request_fast_unwind); } - stack->Unwind(max_s, pc, bp, msan_stack_bounds.stack_top, - msan_stack_bounds.stack_bottom, request_fast_unwind); + uptr stack_bottom = msan_stack_bounds.stack_addr; + uptr stack_top = stack_bottom + msan_stack_bounds.stack_size; + stack->Unwind(max_s, pc, bp, stack_top, stack_bottom, request_fast_unwind); } void PrintWarning(uptr pc, uptr bp) { @@ -324,9 +325,10 @@ void __msan_init() { } Symbolizer::Get()->AddHooks(EnterSymbolizer, ExitSymbolizer); - GetThreadStackTopAndBottom(/* at_initialization */ true, - &msan_stack_bounds.stack_top, - &msan_stack_bounds.stack_bottom); + GetThreadStackAndTls(/* main */ true, &msan_stack_bounds.stack_addr, + &msan_stack_bounds.stack_size, + &msan_stack_bounds.tls_addr, + &msan_stack_bounds.tls_size); VPrintf(1, "MemorySanitizer init done\n"); msan_init_is_running = 0; msan_inited = 1; |

