Add missing SIRT to LoadNativeLibrary.
When we transition to kWaitingForJniOnLoad, we are suspended and
a GC can occur. This caused issues since classloaders are movable.
Change-Id: Iae59019c22ac64322a82300107d06a4323ee602b
diff --git a/runtime/runtime.cc b/runtime/runtime.cc
index d070207..bcd3d31 100644
--- a/runtime/runtime.cc
+++ b/runtime/runtime.cc
@@ -1087,7 +1087,8 @@
std::string mapped_name(StringPrintf(OS_SHARED_LIB_FORMAT_STR, "javacore"));
std::string reason;
self->TransitionFromSuspendedToRunnable();
- if (!instance_->java_vm_->LoadNativeLibrary(mapped_name, NULL, &reason)) {
+ SirtRef<mirror::ClassLoader> class_loader(self, nullptr);
+ if (!instance_->java_vm_->LoadNativeLibrary(mapped_name, class_loader, &reason)) {
LOG(FATAL) << "LoadNativeLibrary failed for \"" << mapped_name << "\": " << reason;
}
self->TransitionFromRunnableToSuspended(kNative);