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()); |