File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -25,8 +25,7 @@ using namespace llvm::sys;
2525class DynamicLibrary ::HandleSet {
2626 typedef std::vector<void *> HandleList;
2727 HandleList Handles;
28- void *Process = nullptr ;
29- bool ProcessAdded = false ;
28+ void *Process = &Invalid;
3029
3130public:
3231 static void *DLOpen (const char *Filename, std::string *Err);
@@ -59,15 +58,14 @@ class DynamicLibrary::HandleSet {
5958 Handles.push_back (Handle);
6059 } else {
6160#ifndef _WIN32
62- if (Process) {
61+ if (Process != &Invalid ) {
6362 if (CanClose)
6463 DLClose (Process);
6564 if (Process == Handle)
6665 return false ;
6766 }
6867#endif
6968 Process = Handle;
70- ProcessAdded = true ;
7169 }
7270 return true ;
7371 }
@@ -99,11 +97,11 @@ class DynamicLibrary::HandleSet {
9997 assert (!((Order & SO_LoadedFirst) && (Order & SO_LoadedLast)) &&
10098 " Invalid Ordering" );
10199
102- if (!ProcessAdded || (Order & SO_LoadedFirst)) {
100+ if (Process == &Invalid || (Order & SO_LoadedFirst)) {
103101 if (void *Ptr = LibLookup (Symbol, Order))
104102 return Ptr;
105103 }
106- if (ProcessAdded ) {
104+ if (Process != &Invalid ) {
107105 // Use OS facilities to search the current binary and all loaded libs.
108106 if (void *Ptr = DLSym (Process, Symbol))
109107 return Ptr;
You can’t perform that action at this time.
0 commit comments