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

Unified Diff: src/execution.cc

Issue 368053002: Stack overflow checkers are now compatible with ASAN's detect_stack_use_after_return mode. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 6 months 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 | « src/execution.h ('k') | src/isolate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/execution.cc
diff --git a/src/execution.cc b/src/execution.cc
index 3a31c7fe86a18be3a9926afaffde8f045277c143..e3eee224771c9202266a2983b03feea2c4c8e55e 100644
--- a/src/execution.cc
+++ b/src/execution.cc
@@ -443,11 +443,9 @@ void StackGuard::ThreadLocal::Clear() {
bool StackGuard::ThreadLocal::Initialize(Isolate* isolate) {
bool should_set_stack_limits = false;
if (real_climit_ == kIllegalLimit) {
- // Takes the address of the limit variable in order to find out where
- // the top of stack is right now.
const uintptr_t kLimitSize = FLAG_stack_size * KB;
- uintptr_t limit = reinterpret_cast<uintptr_t>(&limit) - kLimitSize;
- ASSERT(reinterpret_cast<uintptr_t>(&limit) > kLimitSize);
+ ASSERT(GetCurrentStackPosition() > kLimitSize);
+ uintptr_t limit = GetCurrentStackPosition() - kLimitSize;
real_jslimit_ = SimulatorStack::JsLimitFromCLimit(isolate, limit);
jslimit_ = SimulatorStack::JsLimitFromCLimit(isolate, limit);
real_climit_ = limit;
« no previous file with comments | « src/execution.h ('k') | src/isolate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698