ART: Check a RETURN_VOID_NO_BARRIER like a RETURN_VOID
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
diff --git a/runtime/verifier/method_verifier.cc b/runtime/verifier/method_verifier.cc
index d63b455..0181e5b 100644
--- a/runtime/verifier/method_verifier.cc
+++ b/runtime/verifier/method_verifier.cc
@@ -2874,6 +2874,13 @@
}
}
}
+ // 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