Additional log output for artInvokeCommon code == NULL.
Motivated by an error regarding a possibly corrupted dex file.
Change-Id: I70f8e15151d0c1f00ea2d289a1b43cd88a199290
diff --git a/src/oat/runtime/support_invoke.cc b/src/oat/runtime/support_invoke.cc
index 95dab98..4669688 100644
--- a/src/oat/runtime/support_invoke.cc
+++ b/src/oat/runtime/support_invoke.cc
@@ -38,7 +38,12 @@
const void* code = method->GetCode();
// When we return, the caller will branch to this address, so it had better not be 0!
- CHECK(code != NULL) << PrettyMethod(method);
+ if (UNLIKELY(code == NULL)) {
+ MethodHelper mh(method);
+ LOG(FATAL) << "Code was NULL in method: " << PrettyMethod(method)
+ << " location: " << mh.GetDexFile().GetLocation();
+ }
+
uint32_t method_uint = reinterpret_cast<uint32_t>(method);
uint64_t code_uint = reinterpret_cast<uint32_t>(code);