summaryrefslogtreecommitdiff
path: root/compiler/optimizing
diff options
context:
space:
mode:
author Nicolas Geoffray <ngeoffray@google.com> 2024-12-13 16:57:51 +0000
committer Nicolas Geoffray <ngeoffray@google.com> 2024-12-19 02:20:10 -0800
commitfe38f9fdb72a1ef68ce798307f0760058237b4d3 (patch)
treeee7d3b4a2d026f8a5ddfc5b89491014116fe1aa6 /compiler/optimizing
parent184ee711b88536a821e8a7951a01b1a2aaa5d70d (diff)
Add back a test that was missed from a previous CL.
CL aosp/3370562 refactored method resolution but accidentally removed an ICCE check. Test: 733-icce Bug: 381631627 Change-Id: Ic9ad2f13053c0c81844ee09ed12a99a9fe9b8b99
Diffstat (limited to 'compiler/optimizing')
-rw-r--r--compiler/optimizing/inliner.cc2
-rw-r--r--compiler/optimizing/instruction_builder.cc4
2 files changed, 6 insertions, 0 deletions
diff --git a/compiler/optimizing/inliner.cc b/compiler/optimizing/inliner.cc
index d679261d42..5281346644 100644
--- a/compiler/optimizing/inliner.cc
+++ b/compiler/optimizing/inliner.cc
@@ -1593,6 +1593,8 @@ bool HInliner::TryBuildAndInline(HInvoke* invoke_instruction,
ReferenceTypeInfo receiver_type,
HInstruction** return_replacement,
bool is_speculative) {
+ DCHECK_IMPLIES(method->IsStatic(), !receiver_type.IsValid());
+ DCHECK_IMPLIES(!method->IsStatic(), receiver_type.IsValid());
// If invoke_instruction is devirtualized to a different method, give intrinsics
// another chance before we try to inline it.
if (invoke_instruction->GetResolvedMethod() != method &&
diff --git a/compiler/optimizing/instruction_builder.cc b/compiler/optimizing/instruction_builder.cc
index c66fd3bb26..8226987968 100644
--- a/compiler/optimizing/instruction_builder.cc
+++ b/compiler/optimizing/instruction_builder.cc
@@ -992,6 +992,10 @@ static ArtMethod* ResolveMethod(uint16_t method_idx,
(!resolved_method->IsPublic() && !declaring_class_accessible)) {
return nullptr;
}
+
+ if (UNLIKELY(resolved_method->CheckIncompatibleClassChange(*invoke_type))) {
+ return nullptr;
+ }
}
// We have to special case the invoke-super case, as ClassLinker::ResolveMethod does not.