Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(481)

Unified Diff: runtime/vm/stack_frame.cc

Issue 816123002: MemorySanitizer support. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/scavenger.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,15 @@
}
+// 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, uword fp) {
+ ASSERT(fp != 0);
+ uword size = isolate->GetSpecifiedStackSize();
+ MSAN_UNPOISON(reinterpret_cast<void*>(fp - size), 2 * size);
+}
+
+
StackFrameIterator::StackFrameIterator(bool validate, Isolate* isolate)
: validate_(validate),
entry_(isolate),
@@ -340,6 +350,7 @@
if (!HasNextFrame()) {
return NULL;
}
+ UnpoisonStack(isolate_, frames_.fp_);
if (frames_.pc_ == 0) {
// Iteration starts from an exit frame given by its fp.
current_frame_ = NextExitFrame();
« no previous file with comments | « runtime/vm/scavenger.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698