OSDN Git Service

ART: Remove bad FindSymbol call
authorAndreas Gampe <agampe@google.com>
Tue, 30 Jun 2015 18:23:44 +0000 (11:23 -0700)
committerAndreas Gampe <agampe@google.com>
Tue, 30 Jun 2015 18:30:08 +0000 (11:30 -0700)
The removed call is superfluous under normal operation and harmful
when running a native-bridged library.

Bug: 22194296
Bug: https://code.google.com/p/android-developer-preview/issues/detail?id=2367

(cherry picked from commit 8fec90b421732b3eb278555f57aaf48fda4fa4ba)

Change-Id: I3eb8f435a6a974a3e87a370b254ba8752f2a59b3

runtime/java_vm_ext.cc

index eb9c32d..f1deacf 100644 (file)
@@ -132,6 +132,8 @@ class SharedLibrary {
   }
 
   void* FindSymbol(const std::string& symbol_name) {
+    CHECK(!NeedsNativeBridge());
+
     return dlsym(handle_, symbol_name.c_str());
   }
 
@@ -234,9 +236,6 @@ class Libraries {
           fn = library->FindSymbol(jni_long_name);
         }
       }
-      if (fn == nullptr) {
-        fn = library->FindSymbol(jni_long_name);
-      }
       if (fn != nullptr) {
         VLOG(jni) << "[Found native code for " << PrettyMethod(m)
                   << " in \"" << library->GetPath() << "\"]";