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

Unified Diff: src/isolate.cc

Issue 2494903002: Merged: Avoid calling out to JS during stack overflow (Closed)
Patch Set: Created 4 years, 1 month 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 | test/mjsunit/regress/regress-662935.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/isolate.cc
diff --git a/src/isolate.cc b/src/isolate.cc
index cfb6860d978b1566005f430d7854bd224dc8e9bb..63c927b04c3a7b9392bdab3a7fdde631776faf31 100644
--- a/src/isolate.cc
+++ b/src/isolate.cc
@@ -1735,6 +1735,9 @@ void Isolate::PopPromise() {
bool Isolate::PromiseHasUserDefinedRejectHandler(Handle<Object> promise) {
Handle<JSFunction> fun = promise_has_user_defined_reject_handler();
Handle<Object> has_reject_handler;
+ // If we are, e.g., overflowing the stack, don't try to call out to JS
+ if (!AllowJavascriptExecution::IsAllowed(this)) return false;
+ // Call the registered function to check for a handler
if (Execution::TryCall(this, fun, promise, 0, NULL)
.ToHandle(&has_reject_handler)) {
return has_reject_handler->IsTrue(this);
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-662935.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698