Index: src/compiler/node.cc |
diff --git a/src/compiler/node.cc b/src/compiler/node.cc |
index c60822e3d48f1894061d7aaf3ece14bbb80b5923..d12aeb82b3572c1d44b966c95335147e84ea3337 100644 |
--- a/src/compiler/node.cc |
+++ b/src/compiler/node.cc |
@@ -11,10 +11,16 @@ namespace internal { |
namespace compiler { |
void Node::CollectProjections(NodeVector* projections) { |
+ for (size_t i = 0; i < projections->size(); i++) { |
+ (*projections)[i] = NULL; |
titzer
2014/08/25 13:17:13
I think you can use projections->at(i) here.
|
+ } |
for (UseIter i = uses().begin(); i != uses().end(); ++i) { |
if ((*i)->opcode() != IrOpcode::kProjection) continue; |
- DCHECK_GE(OpParameter<int32_t>(*i), 0); |
- projections->push_back(*i); |
+ int32_t index = OpParameter<int32_t>(*i); |
+ DCHECK_GE(index, 0); |
+ DCHECK_LT(index, projections->size()); |
+ DCHECK_EQ(NULL, (*projections)[index]); |
+ (*projections)[index] = *i; |
} |
} |