From bc919af448aef9e8043e56ca83a2aa4ff90b9ad6 Mon Sep 17 00:00:00 2001 From: Andreas Gampe Date: Wed, 10 Jul 2019 14:09:51 -0700 Subject: ART: Disallow unresolved return types after Q For apps targeting future releases, do not allow type mismatches involving unresolved types. The behavior complicates the verifier and the runtime and does not conform to regular expected behavior. Historically this has been done for app compatibility when non-native multidex was a thing. In that situation, even at runtime when an "early" class is being verified a type might not be available because it is supplied by a later injected dex file. Classloader manipulations in this way are no longer supported. Classes have to be available at verification time to not fail the class. Bug: 121245951 Test: m test-art-host Change-Id: I9608c79183be7b85b76892498d6a7007a29f2434 --- runtime/interpreter/interpreter_switch_impl-inl.h | 1 + 1 file changed, 1 insertion(+) (limited to 'runtime/interpreter/interpreter_switch_impl-inl.h') diff --git a/runtime/interpreter/interpreter_switch_impl-inl.h b/runtime/interpreter/interpreter_switch_impl-inl.h index fc3005d72c..56b84a0601 100644 --- a/runtime/interpreter/interpreter_switch_impl-inl.h +++ b/runtime/interpreter/interpreter_switch_impl-inl.h @@ -502,6 +502,7 @@ class InstructionHandler { return false; // Pending exception. } if (!obj_result->VerifierInstanceOf(return_type)) { + CHECK_LE(Runtime::Current()->GetTargetSdkVersion(), 29u); // This should never happen. std::string temp1, temp2; self->ThrowNewExceptionF("Ljava/lang/InternalError;", -- cgit v1.2.3-59-g8ed1b