7131f4d
From 530af9cb8e700e7596b3ec812bad123c9fa06356 Mon Sep 17 00:00:00 2001
7131f4d
From: Fedor Indutny <fedor@indutny.com>
7131f4d
Date: Wed, 30 Jul 2014 15:33:52 -0700
7131f4d
Subject: [PATCH] v8: Interrupts must not mask stack overflow.
7131f4d
7131f4d
Backport of https://codereview.chromium.org/339883002
7131f4d
---
7131f4d
 src/isolate.h | 9 ++-------
7131f4d
 1 file changed, 2 insertions(+), 7 deletions(-)
7131f4d
7131f4d
diff --git a/src/isolate.h b/src/isolate.h
7131f4d
index b90191d..2769ca7 100644
7131f4d
--- a/src/isolate.h
7131f4d
+++ b/src/isolate.h
7131f4d
@@ -1392,14 +1392,9 @@ class StackLimitCheck BASE_EMBEDDED {
7131f4d
  public:
7131f4d
   explicit StackLimitCheck(Isolate* isolate) : isolate_(isolate) { }
7131f4d
 
7131f4d
-  bool HasOverflowed() const {
7131f4d
+  inline bool HasOverflowed() const {
7131f4d
     StackGuard* stack_guard = isolate_->stack_guard();
7131f4d
-    // Stack has overflowed in C++ code only if stack pointer exceeds the C++
7131f4d
-    // stack guard and the limits are not set to interrupt values.
7131f4d
-    // TODO(214): Stack overflows are ignored if a interrupt is pending. This
7131f4d
-    // code should probably always use the initial C++ limit.
7131f4d
-    return (reinterpret_cast<uintptr_t>(this) < stack_guard->climit()) &&
7131f4d
-           stack_guard->IsStackOverflow();
7131f4d
+    return reinterpret_cast<uintptr_t>(this) < stack_guard->real_climit();
7131f4d
   }
7131f4d
  private:
7131f4d
   Isolate* isolate_;
7131f4d
-- 
7131f4d
2.0.3