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

Unified Diff: src/isolate.cc

Issue 2487833002: 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 995b2628becda2e6e9ead6f69e46c4563636535e..50fa31412a1eb7680ba5f1e293954a1311a79ceb 100644
--- a/src/isolate.cc
+++ b/src/isolate.cc
@@ -1775,6 +1775,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