OSDN Git Service

ART: Check a RETURN_VOID_NO_BARRIER like a RETURN_VOID
authorAndreas Gampe <agampe@google.com>
Fri, 31 Jul 2015 20:36:10 +0000 (13:36 -0700)
committerAndreas Gampe <agampe@google.com>
Sat, 1 Aug 2015 04:12:45 +0000 (21:12 -0700)
RETURN_VOID_NO_BARRIER is used in all methods with return-void,
as long as they're not a constructor and have been quickened. As
such, do the regular checking of the return type.

Bug: https://code.google.com/p/android/issues/detail?id=181700
Bug: 22871329
Change-Id: I11bcf7bffd91fc01995b703a99e603ddb370016e

runtime/verifier/method_verifier.cc

index d63b455..0181e5b 100644 (file)
@@ -2874,6 +2874,13 @@ bool MethodVerifier::CodeFlowVerifyInstruction(uint32_t* start_guess) {
           }
         }
       }
+      // Handle this like a RETURN_VOID now. Code is duplicated to separate standard from
+      // quickened opcodes (otherwise this could be a fall-through).
+      if (!IsConstructor()) {
+        if (!GetMethodReturnType().IsConflict()) {
+          Fail(VERIFY_ERROR_BAD_CLASS_HARD) << "return-void not expected";
+        }
+      }
       break;
     // Note: the following instructions encode offsets derived from class linking.
     // As such they use Class*/Field*/AbstractMethod* as these offsets only have