From: David Brazdil Date: Tue, 19 Apr 2016 09:10:17 +0000 (+0100) Subject: ART: Fix IsLinearOrderWellFormed in liveness analysis X-Git-Tag: android-x86-7.1-r1~45^2~162 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=14b0b23a2f8b1c18274f945f82c6f30a27c0daaa;p=android-x86%2Fart.git ART: Fix IsLinearOrderWellFormed in liveness analysis Graph may contain nullptr in list of basic blocks when the basic block is removed. So we must handle nullptr explicitly. Bug: 28252537 Bug: 27615840 Bug: 27624868 Change-Id: If430939b8fe793e4a9c974936180d06c1a9f90c6 Signed-off-by: Serguei Katkov (cherry picked from commit fa3091ef031da6c18478fdede12d7762634ee271) --- diff --git a/compiler/optimizing/ssa_liveness_analysis.h b/compiler/optimizing/ssa_liveness_analysis.h index 719feec46..40dab74a2 100644 --- a/compiler/optimizing/ssa_liveness_analysis.h +++ b/compiler/optimizing/ssa_liveness_analysis.h @@ -971,7 +971,7 @@ class LiveInterval : public ArenaObject { bool IsLinearOrderWellFormed(const HGraph& graph) { for (HBasicBlock* header : graph.GetBlocks()) { - if (!header->IsLoopHeader()) { + if (header == nullptr || !header->IsLoopHeader()) { continue; } diff --git a/test/594-checker-irreducible-linorder/smali/IrreducibleLoop.smali b/test/594-checker-irreducible-linorder/smali/IrreducibleLoop.smali index 8e0108484..366c7b9b6 100644 --- a/test/594-checker-irreducible-linorder/smali/IrreducibleLoop.smali +++ b/test/594-checker-irreducible-linorder/smali/IrreducibleLoop.smali @@ -40,6 +40,11 @@ invoke-static {v0}, Ljava/lang/System;->exit(I)V goto :body1 + # Trivially dead code to ensure linear order verification skips removed blocks (b/28252537). + :dead_code + nop + goto :dead_code + :header mul-int/2addr p3, p3 if-eqz p1, :body2