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

Unified Diff: runtime/vm/dart_entry.cc

Issue 1513993004: Fix stack overflow check in InvokeClosure. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 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 | tests/language/language.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/dart_entry.cc
diff --git a/runtime/vm/dart_entry.cc b/runtime/vm/dart_entry.cc
index 5a252e57a14d6a71c4c1b071aaecaea59f631549..4ae6851f5b194244eee3d29b7087084a557a50fc 100644
--- a/runtime/vm/dart_entry.cc
+++ b/runtime/vm/dart_entry.cc
@@ -167,15 +167,15 @@ RawObject* DartEntry::InvokeClosure(const Array& arguments,
while (!cls.IsNull()) {
function ^= cls.LookupDynamicFunction(getter_name);
if (!function.IsNull()) {
- // Getters don't have a stack overflow check, so do one in C++.
-
Isolate* isolate = Isolate::Current();
-#if defined(USING_SIMULATOR)
- uword stack_pos = Simulator::Current()->get_register(SPREG);
-#else
- uword stack_pos = Isolate::GetCurrentStackPointer();
+ uword c_stack_pos = Isolate::GetCurrentStackPointer();
+ uword c_stack_limit = OSThread::Current()->stack_base() -
+ OSThread::GetSpecifiedStackSize();
+#if !defined(USING_SIMULATOR)
+ ASSERT(c_stack_limit == isolate->saved_stack_limit());
#endif
- if (stack_pos < isolate->saved_stack_limit()) {
+
+ if (c_stack_pos < c_stack_limit) {
const Instance& exception =
Instance::Handle(isolate->object_store()->stack_overflow());
return UnhandledException::New(exception, Stacktrace::Handle());
« no previous file with comments | « no previous file | tests/language/language.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698