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

Unified Diff: src/isolate.cc

Issue 2361333003: Fix crash from turning on DevTools in the middle of catch prediction (Closed)
Patch Set: Format Created 4 years, 3 months 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/harmony/async-debug-caught-exception.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 01d9b0df1d7ae8ba6a5425955b0092cc3723ad9a..d25cf6112a80cc2ad9ff5a8cfb45956a140ac6e4 100644
--- a/src/isolate.cc
+++ b/src/isolate.cc
@@ -1751,18 +1751,20 @@ Handle<Object> Isolate::GetPromiseOnStackOnThrow() {
}
return retval;
case HandlerTable::PROMISE:
- return promise_on_stack->promise();
+ return promise_on_stack
+ ? Handle<Object>::cast(promise_on_stack->promise())
+ : undefined;
case HandlerTable::ASYNC_AWAIT: {
// If in the initial portion of async/await, continue the loop to pop up
// successive async/await stack frames until an asynchronous one with
// dependents is found, or a non-async stack frame is encountered, in
// order to handle the synchronous async/await catch prediction case:
// assume that async function calls are awaited.
- retval = promise_on_stack->promise();
+ if (promise_on_stack) retval = promise_on_stack->promise();
gsathya 2016/09/24 01:14:09 Can you not return early if you hit an undefined?
Dan Ehrenberg 2016/09/24 03:08:20 You're right, that's a cleaner way to do it. Fixed
if (PromiseHasUserDefinedRejectHandler(retval)) {
return retval;
}
- promise_on_stack = promise_on_stack->prev();
+ if (promise_on_stack) promise_on_stack = promise_on_stack->prev();
continue;
gsathya 2016/09/24 01:14:09 Do you need this continue?
Dan Ehrenberg 2016/09/24 03:08:20 In this switch statement, each case ends with eith
}
}
« no previous file with comments | « no previous file | test/mjsunit/harmony/async-debug-caught-exception.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698