Index: src/compiler/control-reducer.cc |
diff --git a/src/compiler/control-reducer.cc b/src/compiler/control-reducer.cc |
index df302dd8ed838f37c6d7045cdea78d2be6b1c3b5..d20c8dd806d7249c48b425bda02c324fa411703b 100644 |
--- a/src/compiler/control-reducer.cc |
+++ b/src/compiler/control-reducer.cc |
@@ -291,12 +291,23 @@ class ControlReducerImpl { |
} |
#if DEBUG |
// Verify that no inputs to live nodes are NULL. |
- for (size_t j = 0; j < nodes.size(); j++) { |
- Node* node = nodes[j]; |
- for (Node* const input : node->inputs()) { |
- CHECK(input); |
+ for (Node* node : nodes) { |
+ for (int index = 0; index < node->InputCount(); index++) { |
+ Node* input = node->InputAt(index); |
+ if (input == nullptr) { |
+ std::ostringstream str; |
+ str << "GraphError: node #" << node->id() << ":" << *node->op() |
+ << "(input @" << index << ") == null"; |
+ FATAL(str.str().c_str()); |
+ } |
+ if (input->opcode() == IrOpcode::kDead) { |
+ std::ostringstream str; |
+ str << "GraphError: node #" << node->id() << ":" << *node->op() |
+ << "(input @" << index << ") == dead"; |
+ FATAL(str.str().c_str()); |
+ } |
} |
- for (Node* const use : node->uses()) { |
+ for (Node* use : node->uses()) { |
CHECK(marked.IsReachableFromEnd(use)); |
} |
} |