Set more RTI only if they are valid
Follow-up to aosp/2442280. We haven't seen crashes with these ones,
but we can't guarantee that the RTI will be valid in these code paths.
Test: art/test/testrunner/testrunner.py --host --64 --optimizing -b
Change-Id: I80da85a6549ba0275a80027016363e0cf9fb8045
diff --git a/compiler/optimizing/select_generator.cc b/compiler/optimizing/select_generator.cc
index 761e7b5..6a10440 100644
--- a/compiler/optimizing/select_generator.cc
+++ b/compiler/optimizing/select_generator.cc
@@ -160,7 +160,7 @@
ReferenceTypePropagation::FixUpInstructionType(select, graph_->GetHandleCache());
}
} else if (phi->GetType() == DataType::Type::kReference) {
- select->SetReferenceTypeInfo(phi->GetReferenceTypeInfo());
+ select->SetReferenceTypeInfoIfValid(phi->GetReferenceTypeInfo());
}
block->InsertInstructionBefore(select, if_instruction);