Index: src/hydrogen.cc |
diff --git a/src/hydrogen.cc b/src/hydrogen.cc |
index 7e20aafb55825ac11de76f3b503fca0f08fcb1ff..86c6a0594a0a5cfca34d75467658a7607bb24f6a 100644 |
--- a/src/hydrogen.cc |
+++ b/src/hydrogen.cc |
@@ -957,8 +957,9 @@ void HGraphBuilder::LoopBuilder::EndBody() { |
// Push the new increment value on the expression stack to merge into the phi. |
builder_->environment()->Push(increment_); |
- builder_->current_block()->GotoNoSimulate(header_block_); |
- header_block_->loop_information()->RegisterBackEdge(body_block_); |
+ HBasicBlock* last_block = builder_->current_block(); |
+ last_block->GotoNoSimulate(header_block_); |
+ header_block_->loop_information()->RegisterBackEdge(last_block); |
builder_->set_current_block(exit_block_); |
// Pop the phi from the expression stack |