Index: src/compiler/ast-graph-builder.cc |
diff --git a/src/compiler/ast-graph-builder.cc b/src/compiler/ast-graph-builder.cc |
index 2c74d7fb22a641a31590151e9ad7e6a6856e9779..92afa4fcc99c49f5cb8d43e74803ac99ec970366 100644 |
--- a/src/compiler/ast-graph-builder.cc |
+++ b/src/compiler/ast-graph-builder.cc |
@@ -1204,7 +1204,6 @@ void AstGraphBuilder::VisitSwitchStatement(SwitchStatement* stmt) { |
// Keep the switch value on the stack until a case matches. |
VisitForValue(stmt->tag()); |
- Node* tag = environment()->Top(); |
// Iterate over all cases and create nodes for label comparison. |
for (int i = 0; i < clauses->length(); i++) { |
@@ -1220,6 +1219,7 @@ void AstGraphBuilder::VisitSwitchStatement(SwitchStatement* stmt) { |
// value is still on the operand stack while the label is evaluated. |
VisitForValue(clause->label()); |
Node* label = environment()->Pop(); |
+ Node* tag = environment()->Top(); |
const Operator* op = javascript()->StrictEqual(); |
Node* condition = NewNode(op, tag, label); |
compare_switch.BeginLabel(i, condition); |