summaryrefslogtreecommitdiff
path: root/runtime/class_linker_test.cc
diff options
context:
space:
mode:
author David Brazdil <dbrazdil@google.com> 2018-12-01 17:54:26 +0000
committer David Brazdil <dbrazdil@google.com> 2018-12-03 20:19:40 +0000
commit1a6586327d9de6374f9e7ca98d071f2943b03c99 (patch)
tree1d118af8f32855ef0036080d5e8a560f14e5e482 /runtime/class_linker_test.cc
parentd378a567a435a80be9ab7eb8bfe0359c1240c0ff (diff)
Keep pointer to original DexFile during JVMTI redefine for hiddenapi
JVMTI redefine overwrites the pointer to the class' DexFile which prevents access checks from reading the hiddenapi flags store. Store the pointer in ClassExt together with the original ClassDef index to preserve the access to flags store. Because method/field indices are still lost, the corresponding dex member is found using string comparison of member's name and type. Bug: 119688837 Test: 999-redefine-hiddenapi Change-Id: Ifdf35668e838869a971233bbaae61851014658b1
Diffstat (limited to 'runtime/class_linker_test.cc')
-rw-r--r--runtime/class_linker_test.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/runtime/class_linker_test.cc b/runtime/class_linker_test.cc
index 56fdd06ff2..fe45b9e1f0 100644
--- a/runtime/class_linker_test.cc
+++ b/runtime/class_linker_test.cc
@@ -611,6 +611,10 @@ struct ClassExtOffsets : public CheckOffsets<mirror::ClassExt> {
addOffset(OFFSETOF_MEMBER(mirror::ClassExt, obsolete_dex_caches_), "obsoleteDexCaches");
addOffset(OFFSETOF_MEMBER(mirror::ClassExt, obsolete_methods_), "obsoleteMethods");
addOffset(OFFSETOF_MEMBER(mirror::ClassExt, original_dex_file_), "originalDexFile");
+ addOffset(OFFSETOF_MEMBER(mirror::ClassExt, pre_redefine_class_def_index_),
+ "preRedefineClassDefIndex");
+ addOffset(OFFSETOF_MEMBER(mirror::ClassExt, pre_redefine_dex_file_ptr_),
+ "preRedefineDexFilePtr");
addOffset(OFFSETOF_MEMBER(mirror::ClassExt, verify_error_), "verifyError");
}
};