diff options
Diffstat (limited to 'Source/JavaScriptCore/runtime/StringRecursionChecker.h')
-rw-r--r-- | Source/JavaScriptCore/runtime/StringRecursionChecker.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Source/JavaScriptCore/runtime/StringRecursionChecker.h b/Source/JavaScriptCore/runtime/StringRecursionChecker.h index 831e25b46..a1b4a51fe 100644 --- a/Source/JavaScriptCore/runtime/StringRecursionChecker.h +++ b/Source/JavaScriptCore/runtime/StringRecursionChecker.h @@ -22,6 +22,7 @@ #include "Interpreter.h" #include <wtf/StackStats.h> +#include <wtf/WTFThreadData.h> namespace JSC { @@ -48,8 +49,8 @@ private: inline JSValue StringRecursionChecker::performCheck() { - int size = m_exec->globalData().stringRecursionCheckVisitedObjects.size(); - if (size >= MaxSmallThreadReentryDepth && size >= m_exec->globalData().maxReentryDepth) + const StackBounds& nativeStack = wtfThreadData().stack(); + if (!nativeStack.isSafeToRecurse()) return throwStackOverflowError(); bool alreadyVisited = !m_exec->globalData().stringRecursionCheckVisitedObjects.add(m_thisObject).isNewEntry; if (alreadyVisited) |