Index: src/hydrogen.cc |
diff --git a/src/hydrogen.cc b/src/hydrogen.cc |
index 7917ef40ae14e735b5eff4e24f6fa42b0f0089f2..2c65eeade2aa1ace7092be267095785277baf040 100644 |
--- a/src/hydrogen.cc |
+++ b/src/hydrogen.cc |
@@ -1813,17 +1813,15 @@ void HGraph::InsertRepresentationChangeForUse(HValue* value, |
bool is_truncating) { |
// Insert the representation change right before its use. For phi-uses we |
// insert at the end of the corresponding predecessor. |
- HBasicBlock* insert_block = use->block(); |
+ HInstruction* next = NULL; |
if (use->IsPhi()) { |
int index = 0; |
while (use->OperandAt(index) != value) ++index; |
- insert_block = insert_block->predecessors()->at(index); |
+ next = use->block()->predecessors()->at(index)->end(); |
+ } else { |
+ next = HInstruction::cast(use); |
} |
- HInstruction* next = (insert_block == use->block()) |
- ? HInstruction::cast(use) |
- : insert_block->end(); |
- |
// For constants we try to make the representation change at compile |
// time. When a representation change is not possible without loss of |
// information we treat constants like normal instructions and insert the |