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
diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc
index 8982368..f396a0a 100644
--- a/runtime/class_linker.cc
+++ b/runtime/class_linker.cc
@@ -9920,6 +9920,12 @@
UNREACHABLE();
}
+void ClassLinker::SetEnablePublicSdkChecks(bool enabled ATTRIBUTE_UNUSED) {
+ // Should not be called on ClassLinker, only on AotClassLinker that overrides this.
+ LOG(FATAL) << "UNREACHABLE";
+ UNREACHABLE();
+}
+
// Instantiate ClassLinker::ResolveMethod.
template ArtMethod* ClassLinker::ResolveMethod<ClassLinker::ResolveMode::kCheckICCEAndIAE>(
uint32_t method_idx,