summaryrefslogtreecommitdiff
path: root/runtime/class_linker.h
diff options
context:
space:
mode:
author Calin Juravle <calin@google.com> 2021-01-14 19:54:23 -0800
committer Calin Juravle <calin@google.com> 2021-01-21 00:33:57 +0000
commit2c2724cb36cd5a9cec6c852c681efc3b7c6b86ea (patch)
tree203b76db53f102d031e43ea0632194d4517d6bec /runtime/class_linker.h
parent350c2ff41ff234c71b21f8e653e44be0e23504d9 (diff)
Disable the public SDK Checker during exception throwing
The compiler will try to throw exception when it cannot resolved methods/classes or when there's an incompatible class change. While doing so, it requires the thrown exception class to be initialized. However, when verifying with a public SDK Checker installed, it's possible that the exception class may not initialized due to private member access (e.g. serialVersionUid). Since during verification the exceptions are simply mechanism for the compiler to propagate the verification error it is OK to disable the SDK Checker and allow the class to be initialized. Bug: 177017481 Test: m test-art-host & manual Change-Id: I3765897bf9885b7e26b3ab044002df88866cd3cd
Diffstat (limited to 'runtime/class_linker.h')
-rw-r--r--runtime/class_linker.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/runtime/class_linker.h b/runtime/class_linker.h
index 94d19995c1..050b02a42f 100644
--- a/runtime/class_linker.h
+++ b/runtime/class_linker.h
@@ -825,13 +825,15 @@ class ClassLinker {
REQUIRES(!Locks::dex_lock_, !Roles::uninterruptible_);
// Verifies if the method is accesible according to the SdkChecker (if installed).
- virtual bool DenyAccessBasedOnPublicSdk(ArtMethod* art_method ATTRIBUTE_UNUSED) const
+ virtual bool DenyAccessBasedOnPublicSdk(ArtMethod* art_method) const
REQUIRES_SHARED(Locks::mutator_lock_);
// Verifies if the field is accesible according to the SdkChecker (if installed).
- virtual bool DenyAccessBasedOnPublicSdk(ArtField* art_field ATTRIBUTE_UNUSED) const
+ virtual bool DenyAccessBasedOnPublicSdk(ArtField* art_field) const
REQUIRES_SHARED(Locks::mutator_lock_);
// Verifies if the descriptor is accesible according to the SdkChecker (if installed).
- virtual bool DenyAccessBasedOnPublicSdk(const char* type_descriptor ATTRIBUTE_UNUSED) const;
+ virtual bool DenyAccessBasedOnPublicSdk(const char* type_descriptor) const;
+ // Enable or disable public sdk checks.
+ virtual void SetEnablePublicSdkChecks(bool enabled);
protected:
virtual bool InitializeClass(Thread* self,