From 2cc9d343550d22e08536e0077893e6d86647c91a Mon Sep 17 00:00:00 2001 From: Nicolas Geoffray Date: Fri, 26 Apr 2019 14:21:14 +0100 Subject: Fix wrong assumption in RemoveInstructionsAsUsersFromDeadBlocks. It can be called in a situation where dead blocks can have phis: the DCE pass would re-build the dominator tree and RemoveInstructionsAsUsersFromDeadBlocks used to assume there cannot be phis. Test: 695-simplify-throws Bug: 131174581 Change-Id: I853956482487a8c7c8fb99499aef318d099754e4 --- compiler/optimizing/nodes.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'compiler/optimizing/nodes.cc') diff --git a/compiler/optimizing/nodes.cc b/compiler/optimizing/nodes.cc index f7c16d1d02..1940d55a9d 100644 --- a/compiler/optimizing/nodes.cc +++ b/compiler/optimizing/nodes.cc @@ -147,7 +147,9 @@ void HGraph::RemoveInstructionsAsUsersFromDeadBlocks(const ArenaBitVector& visit if (!visited.IsBitSet(i)) { HBasicBlock* block = blocks_[i]; if (block == nullptr) continue; - DCHECK(block->GetPhis().IsEmpty()) << "Phis are not inserted at this stage"; + for (HInstructionIterator it(block->GetPhis()); !it.Done(); it.Advance()) { + RemoveAsUser(it.Current()); + } for (HInstructionIterator it(block->GetInstructions()); !it.Done(); it.Advance()) { RemoveAsUser(it.Current()); } -- cgit v1.2.3-59-g8ed1b