summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Almaz Mingaleev <mingaleev@google.com> 2025-01-14 13:43:23 +0000
committer Almaz Mingaleev <mingaleev@google.com> 2025-01-15 00:12:28 -0800
commit55bed4cd5c61546f9d65f16c0e84cc26728d88c5 (patch)
tree47306375cdcbb763d44269cac0c9886e9331a9b0
parent27123e7573790ed6c7ad6c3865231385b533b00a (diff)
Minimal hiddenapibypass breakage demo.
Bug: n/a Test: n/a Change-Id: I5bbd2cce80d3917f2bb02b5b99a65ed53ee7223b
-rw-r--r--runtime/class_linker_test.cc2
-rw-r--r--runtime/mirror/method_handle_impl.h3
2 files changed, 5 insertions, 0 deletions
diff --git a/runtime/class_linker_test.cc b/runtime/class_linker_test.cc
index d4fcefef27..5d5d025050 100644
--- a/runtime/class_linker_test.cc
+++ b/runtime/class_linker_test.cc
@@ -777,6 +777,8 @@ struct MethodHandleOffsets : public CheckOffsets<mirror::MethodHandle> {
struct MethodHandleImplOffsets : public CheckOffsets<mirror::MethodHandleImpl> {
MethodHandleImplOffsets() : CheckOffsets<mirror::MethodHandleImpl>(
false, "Ljava/lang/invoke/MethodHandleImpl;") {
+ addOffset(OFFSETOF_MEMBER(mirror::MethodHandleImpl, field_), "field");
+ addOffset(OFFSETOF_MEMBER(mirror::MethodHandleImpl, target_), "target");
addOffset(OFFSETOF_MEMBER(mirror::MethodHandleImpl, target_class_or_info_),
"targetClassOrMethodHandleInfo");
}
diff --git a/runtime/mirror/method_handle_impl.h b/runtime/mirror/method_handle_impl.h
index 427a20013e..b5d1d9ad25 100644
--- a/runtime/mirror/method_handle_impl.h
+++ b/runtime/mirror/method_handle_impl.h
@@ -22,6 +22,7 @@
#include "base/macros.h"
#include "class.h"
#include "method_type.h"
+#include "mirror/field.h"
#include "obj_ptr.h"
#include "object.h"
@@ -128,7 +129,9 @@ class MANAGED MethodHandleImpl : public MethodHandle {
REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!Roles::uninterruptible_);
private:
+ HeapReference<mirror::Field> field_;
HeapReference<mirror::Object> target_class_or_info_; // Unused by the runtime.
+ uint64_t target_;
friend struct art::MethodHandleImplOffsets; // for verifying offset information
DISALLOW_IMPLICIT_CONSTRUCTORS(MethodHandleImpl);