Index: src/compiler/ast-graph-builder.cc |
diff --git a/src/compiler/ast-graph-builder.cc b/src/compiler/ast-graph-builder.cc |
index a63744e2f34a41795e368e6dedc40d93d73c2fc2..d3506e7550c7a036c0f23cb1643882c6a293cd1b 100644 |
--- a/src/compiler/ast-graph-builder.cc |
+++ b/src/compiler/ast-graph-builder.cc |
@@ -1474,6 +1474,12 @@ void AstGraphBuilder::VisitTryCatchStatement(TryCatchStatement* stmt) { |
} |
try_control.EndTry(); |
+ // Clear message object as we enter the catch block. |
+ ExternalReference message_object = |
+ ExternalReference::address_of_pending_message_obj(isolate()); |
+ Node* the_hole = jsgraph()->TheHoleConstant(); |
+ BuildStoreExternal(message_object, kMachAnyTagged, the_hole); |
+ |
// Create a catch scope that binds the exception. |
Node* exception = try_control.GetExceptionNode(); |
Unique<String> name = MakeUnique(stmt->variable()->name()); |
@@ -1539,6 +1545,10 @@ void AstGraphBuilder::VisitTryFinallyStatement(TryFinallyStatement* stmt) { |
environment()->Push(result); |
environment()->Push(message); |
+ // Clear message object as we enter the finally block. |
+ Node* the_hole = jsgraph()->TheHoleConstant(); |
+ BuildStoreExternal(message_object, kMachAnyTagged, the_hole); |
+ |
// Evaluate the finally-block. |
Visit(stmt->finally_block()); |
try_control.EndFinally(); |