Index: src/compiler/raw-machine-assembler.cc |
diff --git a/src/compiler/raw-machine-assembler.cc b/src/compiler/raw-machine-assembler.cc |
index 489c2ca6d9c26b0bb002c2224535c6d2b38dc21e..6a339e7c918d0c60350c847e483209f7865daf53 100644 |
--- a/src/compiler/raw-machine-assembler.cc |
+++ b/src/compiler/raw-machine-assembler.cc |
@@ -101,7 +101,8 @@ void RawMachineAssembler::Switch(Node* index, Label* default_label, |
void RawMachineAssembler::Return(Node* value) { |
- schedule()->AddReturn(CurrentBlock(), value); |
+ Node* ret = NewNode(common()->Return(), value); |
+ schedule()->AddReturn(CurrentBlock(), ret); |
current_block_ = NULL; |
} |
@@ -183,7 +184,9 @@ Node* RawMachineAssembler::MakeNode(const Operator* op, int input_count, |
Node* node = graph()->NewNode(op, input_count, inputs, incomplete); |
BasicBlock* block = op->opcode() == IrOpcode::kParameter ? schedule()->start() |
: CurrentBlock(); |
- schedule()->AddNode(block, node); |
+ if (op->opcode() != IrOpcode::kReturn) { |
+ schedule()->AddNode(block, node); |
+ } |
return node; |
} |