Chromium Code Reviews| Index: runtime/vm/stack_frame.cc |
| =================================================================== |
| --- runtime/vm/stack_frame.cc (revision 42458) |
| +++ runtime/vm/stack_frame.cc (working copy) |
| @@ -4,6 +4,7 @@ |
| #include "vm/stack_frame.h" |
| +#include "platform/memory_sanitizer.h" |
| #include "vm/assembler.h" |
| #include "vm/deopt_instructions.h" |
| #include "vm/isolate.h" |
| @@ -278,6 +279,14 @@ |
| } |
| +// Tell MemorySanitizer that generated code initializes part of the stack. |
| +// TODO(koda): Limit to frames that are actually written by generated code. |
| +static void UnpoisonStack(Isolate* isolate) { |
|
siva
2014/12/22 17:01:53
ASSERT(isolate->stack_limit() != ~static_cast<uwor
koda
2014/12/22 23:05:52
Changed to instead take an explicit 'fp' argument,
|
| + __msan_unpoison(reinterpret_cast<void*>(isolate->stack_limit()), |
| + isolate->GetSpecifiedStackSize()); |
| +} |
| + |
| + |
| StackFrameIterator::StackFrameIterator(bool validate, Isolate* isolate) |
| : validate_(validate), |
| entry_(isolate), |
| @@ -287,6 +296,7 @@ |
| isolate_(isolate) { |
| ASSERT((isolate_ == Isolate::Current()) || |
| OS::AllowStackFrameIteratorFromAnotherThread()); |
| + UnpoisonStack(isolate); |
| SetupLastExitFrameData(); // Setup data for last exit frame. |
| } |
| @@ -301,6 +311,7 @@ |
| isolate_(isolate) { |
| ASSERT((isolate_ == Isolate::Current()) || |
| OS::AllowStackFrameIteratorFromAnotherThread()); |
| + UnpoisonStack(isolate); |
| frames_.fp_ = last_fp; |
| frames_.sp_ = 0; |
| frames_.pc_ = 0; |
| @@ -317,6 +328,7 @@ |
| isolate_(isolate) { |
| ASSERT((isolate_ == Isolate::Current()) || |
| OS::AllowStackFrameIteratorFromAnotherThread()); |
| + UnpoisonStack(isolate); |
| frames_.fp_ = fp; |
| frames_.sp_ = sp; |
| frames_.pc_ = pc; |