Index: src/interpreter/bytecode-generator.cc |
diff --git a/src/interpreter/bytecode-generator.cc b/src/interpreter/bytecode-generator.cc |
index f5df790e719cde0efe7fffef6f89e0328a9585c9..a716dd15a458664d4cf3435f5c17dd96fccc6f61 100644 |
--- a/src/interpreter/bytecode-generator.cc |
+++ b/src/interpreter/bytecode-generator.cc |
@@ -409,7 +409,7 @@ void BytecodeGenerator::MakeBytecodeBody() { |
// Visit illegal re-declaration and bail out if it exists. |
if (scope()->HasIllegalRedeclaration()) { |
- Visit(scope()->GetIllegalRedeclaration()); |
+ VisitForEffect(scope()->GetIllegalRedeclaration()); |
return; |
} |
@@ -1521,6 +1521,11 @@ void BytecodeGenerator::VisitYield(Yield* expr) { UNIMPLEMENTED(); } |
void BytecodeGenerator::VisitThrow(Throw* expr) { |
VisitForAccumulatorValue(expr->exception()); |
builder()->Throw(); |
+ // Throw statments are modeled as expression instead of statments. These are |
+ // converted from assignment statements in Rewriter::ReWrite pass. An |
+ // assignment statement expects a value in the accumulator. This is a hack to |
+ // avoid DCHECK fails assert accumulator has been set. |
+ execution_result()->SetResultInAccumulator(); |
} |