From a7e38d8aaacfca85b40b5df654f85c0979968672 Mon Sep 17 00:00:00 2001 From: Alex Light Date: Thu, 19 Jan 2017 14:57:28 -0800 Subject: Use original dex file for retransformation. The spec requires us to pass the dex file as it appeared before any retransformation-capable agents had modified it to the ClassFileLoadHooks when RetransformClasses is called. We do this by saving the initial dex file bytes into the class as a byte[]. Bug: 32369916 Test: mma -j40 test-art-host Change-Id: Ic6af3738cd2a831e91ba1144f502fa58b3c333e4 --- runtime/mirror/class_ext.cc | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'runtime/mirror/class_ext.cc') diff --git a/runtime/mirror/class_ext.cc b/runtime/mirror/class_ext.cc index 7c6a710cef..efd949e031 100644 --- a/runtime/mirror/class_ext.cc +++ b/runtime/mirror/class_ext.cc @@ -113,6 +113,11 @@ void ClassExt::SetVerifyError(ObjPtr err) { } } +void ClassExt::SetOriginalDexFileBytes(ObjPtr bytes) { + DCHECK(!Runtime::Current()->IsActiveTransaction()); + SetFieldObject(OFFSET_OF_OBJECT_MEMBER(ClassExt, original_dex_file_bytes_), bytes); +} + void ClassExt::SetClass(ObjPtr dalvik_system_ClassExt) { CHECK(dalvik_system_ClassExt != nullptr); dalvik_system_ClassExt_ = GcRoot(dalvik_system_ClassExt); -- cgit v1.2.3-59-g8ed1b