diff --git a/src/hydrogen-instructions.cc b/src/hydrogen-instructions.cc index b353cdb2cc..c8b16c2f96 100644 --- a/src/hydrogen-instructions.cc +++ b/src/hydrogen-instructions.cc @@ -790,6 +790,13 @@ void HInstruction::Verify() { // HValue::DataEquals. The default implementation is UNREACHABLE. We // don't actually care whether DataEquals returns true or false here. if (CheckFlag(kUseGVN)) DataEquals(this); + + // Verify that all uses are in the graph. + for (HUseIterator use = uses(); !use.Done(); use.Advance()) { + if (use.value()->IsInstruction()) { + ASSERT(HInstruction::cast(use.value())->IsLinked()); + } + } } #endif diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h index 3e53eca709..20e5b3bd00 100644 --- a/src/hydrogen-instructions.h +++ b/src/hydrogen-instructions.h @@ -1546,7 +1546,7 @@ class HStackCheck: public HTemplateInstruction<1> { // The stack check eliminator might try to eliminate the same stack // check instruction multiple times. if (IsLinked()) { - DeleteFromGraph(); + DeleteAndReplaceWith(NULL); } }