summaryrefslogtreecommitdiff
path: root/runtime/class_linker.cc
diff options
context:
space:
mode:
author Almaz Mingaleev <mingaleev@google.com> 2025-02-26 17:24:26 +0000
committer Almaz Mingaleev <mingaleev@google.com> 2025-03-06 07:01:08 -0800
commitd952b6bb20b906b3ddd4aaf1036777d35ed4d3b5 (patch)
treec819e184bbd4bc8a5600a84c0f27e51dd3c05127 /runtime/class_linker.cc
parent6ffde7f20f7f5e90566be0550b52cab7d1f7ab13 (diff)
Call target method in accessor MHs when it is set.
Bug: 297147201 Test: ./art/tools/run-libcore-tests.sh --mode host --variant X64 Test: ./art/test/testrunner/testrunner.py -b --host --64 Test: ./art/test/testrunner/testrunner.py -b --target --64 Change-Id: I5f8dc0761abbc1f5bb4f5727ae1e6966a4ebaf8a
Diffstat (limited to 'runtime/class_linker.cc')
-rw-r--r--runtime/class_linker.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc
index 70eea2d268..009d705caf 100644
--- a/runtime/class_linker.cc
+++ b/runtime/class_linker.cc
@@ -10569,7 +10569,7 @@ ObjPtr<mirror::MethodHandle> ClassLinker::ResolveMethodHandleForField(
return nullptr;
}
- StackHandleScope<4> hs(self);
+ StackHandleScope<5> hs(self);
ObjPtr<mirror::Class> array_of_class = GetClassRoot<mirror::ObjectArray<mirror::Class>>(this);
Handle<mirror::ObjectArray<mirror::Class>> method_params(hs.NewHandle(
mirror::ObjectArray<mirror::Class>::Alloc(self, array_of_class, num_params)));
@@ -10629,7 +10629,8 @@ ObjPtr<mirror::MethodHandle> ClassLinker::ResolveMethodHandleForField(
return nullptr;
}
- uintptr_t target = reinterpret_cast<uintptr_t>(target_field);
+ Handle<mirror::Field> target(hs.NewHandle(
+ mirror::Field::CreateFromArtField(self, target_field, /*force_resolve=*/ true)));
return mirror::MethodHandleImpl::Create(self, target, kind, method_type);
}