summaryrefslogtreecommitdiff
path: root/compiler/optimizing/instruction_simplifier.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/instruction_simplifier.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/instruction_simplifier.cc')
-rw-r--r--compiler/optimizing/instruction_simplifier.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/optimizing/instruction_simplifier.cc b/compiler/optimizing/instruction_simplifier.cc
index 86b9dbab76..12ca30fb1b 100644
--- a/compiler/optimizing/instruction_simplifier.cc
+++ b/compiler/optimizing/instruction_simplifier.cc
@@ -970,7 +970,7 @@ void InstructionSimplifierVisitor::VisitPredicatedInstanceFieldGet(
pred_get->GetFieldInfo().GetDexFile(),
pred_get->GetDexPc());
if (pred_get->GetType() == DataType::Type::kReference) {
- replace_with->SetReferenceTypeInfo(pred_get->GetReferenceTypeInfo());
+ replace_with->SetReferenceTypeInfoIfValid(pred_get->GetReferenceTypeInfo());
}
pred_get->GetBlock()->InsertInstructionBefore(replace_with, pred_get);
pred_get->ReplaceWith(replace_with);
@@ -2782,7 +2782,7 @@ static bool TryReplaceStringBuilderAppend(HInvoke* invoke) {
ArenaAllocator* allocator = block->GetGraph()->GetAllocator();
HStringBuilderAppend* append = new (allocator) HStringBuilderAppend(
fmt, num_args, has_fp_args, allocator, invoke->GetDexPc());
- append->SetReferenceTypeInfo(invoke->GetReferenceTypeInfo());
+ append->SetReferenceTypeInfoIfValid(invoke->GetReferenceTypeInfo());
for (size_t i = 0; i != num_args; ++i) {
append->SetArgumentAt(i, args[num_args - 1u - i]);
}