summaryrefslogtreecommitdiff
path: root/compiler/optimizing/nodes.cc
diff options
context:
space:
mode:
author Santiago Aboy Solanes <solanes@google.com> 2023-02-20 14:26:23 +0000
committer Santiago Aboy Solanes <solanes@google.com> 2023-02-22 11:47:48 +0000
commite05bc3e1d03e8cba0c16a1b738591a2e972235b6 (patch)
treec5c8e4342b31ad445c0c80cf08cf671dc598e33e /compiler/optimizing/nodes.cc
parent452605be671e499ae2c535f7c7a37587551dc65a (diff)
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
Diffstat (limited to 'compiler/optimizing/nodes.cc')
-rw-r--r--compiler/optimizing/nodes.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/compiler/optimizing/nodes.cc b/compiler/optimizing/nodes.cc
index 0876ce070e..c99cfab05f 100644
--- a/compiler/optimizing/nodes.cc
+++ b/compiler/optimizing/nodes.cc
@@ -688,7 +688,7 @@ void HGraph::TransformLoopToSinglePreheaderFormat(HBasicBlock* header) {
0,
header_phi->GetType());
if (header_phi->GetType() == DataType::Type::kReference) {
- preheader_phi->SetReferenceTypeInfo(header_phi->GetReferenceTypeInfo());
+ preheader_phi->SetReferenceTypeInfoIfValid(header_phi->GetReferenceTypeInfo());
}
preheader->AddPhi(preheader_phi);
@@ -3215,6 +3215,12 @@ void HInstruction::SetReferenceTypeInfo(ReferenceTypeInfo rti) {
SetPackedFlag<kFlagReferenceTypeIsExact>(rti.IsExact());
}
+void HInstruction::SetReferenceTypeInfoIfValid(ReferenceTypeInfo rti) {
+ if (rti.IsValid()) {
+ SetReferenceTypeInfo(rti);
+ }
+}
+
bool HBoundType::InstructionDataEquals(const HInstruction* other) const {
const HBoundType* other_bt = other->AsBoundType();
ScopedObjectAccess soa(Thread::Current());