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

Unified Diff: runtime/vm/profiler.cc

Issue 813163010: Make all tests pass ASAN. (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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/profiler.cc
===================================================================
--- runtime/vm/profiler.cc (revision 42561)
+++ runtime/vm/profiler.cc (working copy)
@@ -2,6 +2,7 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
+#include "platform/address_sanitizer.h"
#include "platform/memory_sanitizer.h"
#include "platform/utils.h"
@@ -1679,8 +1680,11 @@
return;
}
#endif
- const uword pc_marker = *(fp + kPcMarkerSlotFromFp);
- sample->set_pc_marker(pc_marker);
+ uword* pc_marker_ptr = fp + kPcMarkerSlotFromFp;
+ // MSan/ASan are unaware of frames initialized by generated code.
+ MSAN_UNPOISON(pc_marker_ptr, kWordSize);
+ ASAN_UNPOISON(pc_marker_ptr, kWordSize);
+ sample->set_pc_marker(*pc_marker_ptr);
}
}
@@ -1930,7 +1934,11 @@
private:
uword* CallerPC(uword* fp) const {
ASSERT(fp != NULL);
- return reinterpret_cast<uword*>(*(fp + kSavedCallerPcSlotFromFp));
+ uword* caller_pc_ptr = fp + kSavedCallerPcSlotFromFp;
+ // This may actually be uninitialized, by design (see class comment above).
+ MSAN_UNPOISON(caller_pc_ptr, kWordSize);
+ ASAN_UNPOISON(caller_pc_ptr, kWordSize);
+ return reinterpret_cast<uword*>(*caller_pc_ptr);
}
uword* CallerFP(uword* fp) const {
@@ -1938,6 +1946,7 @@
uword* caller_fp_ptr = fp + kSavedCallerFpSlotFromFp;
// This may actually be uninitialized, by design (see class comment above).
MSAN_UNPOISON(caller_fp_ptr, kWordSize);
+ ASAN_UNPOISON(caller_fp_ptr, kWordSize);
return reinterpret_cast<uword*>(*caller_fp_ptr);
}
@@ -2014,8 +2023,8 @@
uword stack_lower = 0;
uword stack_upper = 0;
- isolate->GetProfilerStackBounds(&stack_lower, &stack_upper);
- if ((stack_lower == 0) || (stack_upper == 0)) {
+ if (!isolate->GetProfilerStackBounds(&stack_lower, &stack_upper) ||
+ (stack_lower == 0) || (stack_upper == 0)) {
// Could not get stack boundary.
return;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698