ObjPtr misc cleanup
Check for subtypes in constructor.
Remove various calls to MakeObjPtr and ObjPtr::Ptr.
Bug: 31113334
Test: test-art-host
Change-Id: I8d680d514ea52cd64fc4f7c2e988926bc726174e
diff --git a/runtime/native/java_lang_Class.cc b/runtime/native/java_lang_Class.cc
index 87bff5f..2a5c04d 100644
--- a/runtime/native/java_lang_Class.cc
+++ b/runtime/native/java_lang_Class.cc
@@ -677,11 +677,10 @@
if (caller.Get() == nullptr) {
caller.Assign(GetCallingClass(soa.Self(), 1));
}
- if (UNLIKELY(caller.Get() != nullptr && !VerifyAccess(
- MakeObjPtr(receiver.Get()),
- MakeObjPtr(declaring_class),
- constructor->GetAccessFlags(),
- MakeObjPtr(caller.Get())))) {
+ if (UNLIKELY(caller.Get() != nullptr && !VerifyAccess(receiver.Get(),
+ declaring_class,
+ constructor->GetAccessFlags(),
+ caller.Get()))) {
soa.Self()->ThrowNewExceptionF(
"Ljava/lang/IllegalAccessException;", "%s is not accessible from %s",
PrettyMethod(constructor).c_str(), PrettyClass(caller.Get()).c_str());