diff options
author | 2015-03-24 18:49:14 +0000 | |
---|---|---|
committer | 2015-03-24 19:13:13 +0000 | |
commit | 10f56cb6b4e39ed0032e9a23b179b557463e65ad (patch) | |
tree | 9f53251569ed32af7add31cf16206f255261b97e /compiler/optimizing/nodes.h | |
parent | 3e690d11d26b3ae3891a03cdef88e7c2272109f5 (diff) |
ART: Fix crash in gtests
SsaLivenessAnalysis was crashing after change of iteration order in
142377 because gtests do not always build reverse post order.
Change-Id: If5ad5b7c52040b119c4415f0b942988049fa3c16
Diffstat (limited to 'compiler/optimizing/nodes.h')
-rw-r--r-- | compiler/optimizing/nodes.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/compiler/optimizing/nodes.h b/compiler/optimizing/nodes.h index 97ade0dc62..db7873b14e 100644 --- a/compiler/optimizing/nodes.h +++ b/compiler/optimizing/nodes.h @@ -3483,7 +3483,10 @@ class HInsertionOrderIterator : public ValueObject { class HReversePostOrderIterator : public ValueObject { public: - explicit HReversePostOrderIterator(const HGraph& graph) : graph_(graph), index_(0) {} + explicit HReversePostOrderIterator(const HGraph& graph) : graph_(graph), index_(0) { + // Check that reverse post order of the graph has been built. + DCHECK(!graph.GetReversePostOrder().IsEmpty()); + } bool Done() const { return index_ == graph_.GetReversePostOrder().Size(); } HBasicBlock* Current() const { return graph_.GetReversePostOrder().Get(index_); } @@ -3499,7 +3502,10 @@ class HReversePostOrderIterator : public ValueObject { class HPostOrderIterator : public ValueObject { public: explicit HPostOrderIterator(const HGraph& graph) - : graph_(graph), index_(graph_.GetReversePostOrder().Size()) {} + : graph_(graph), index_(graph_.GetReversePostOrder().Size()) { + // Check that reverse post order of the graph has been built. + DCHECK(!graph.GetReversePostOrder().IsEmpty()); + } bool Done() const { return index_ == 0; } HBasicBlock* Current() const { return graph_.GetReversePostOrder().Get(index_ - 1); } |