NullHandle<mirror::ClassLoader>(),
NullHandle<mirror::ArtMethod>(),
invoke_type);
- CHECK(method != NULL) << PrettyMethod(it.GetMemberIndex(), *dex_file_, true);
+ if (method == nullptr) {
+ LOG(ERROR) << "Unexpected failure to resolve a method: "
+ << PrettyMethod(it.GetMemberIndex(), *dex_file_, true);
+ soa.Self()->AssertPendingException();
+ mirror::Throwable* exc = soa.Self()->GetException(nullptr);
+ std::string dump = exc->Dump();
+ LOG(FATAL) << dump;
+ }
// Portable code offsets are set by ElfWriterMclinker::FixupCompiledCodeOffset after linking.
method->SetQuickOatCodeOffset(offsets.code_offset_);
method->SetOatNativeGcMapOffset(offsets.gc_map_offset_);
(*tlsPtr_.name == kThreadNameDuringStartup);
}
+void Thread::AssertPendingException() const {
+ if (UNLIKELY(!IsExceptionPending())) {
+ LOG(FATAL) << "Pending exception expected.";
+ }
+}
+
void Thread::AssertNoPendingException() const {
if (UNLIKELY(IsExceptionPending())) {
ScopedObjectAccess soa(Thread::Current());
return tlsPtr_.exception;
}
+ void AssertPendingException() const;
void AssertNoPendingException() const;
void AssertNoPendingExceptionForNewException(const char* msg) const;