[Windows] Partially revert r254363 until I can test the right fix.
Reported by: David Blaikie
llvm-svn: 254378
diff --git a/llvm/lib/Support/Windows/DynamicLibrary.inc b/llvm/lib/Support/Windows/DynamicLibrary.inc
index e612283..17418b0 100644
--- a/llvm/lib/Support/Windows/DynamicLibrary.inc
+++ b/llvm/lib/Support/Windows/DynamicLibrary.inc
@@ -60,8 +60,12 @@
if (OpenedHandles == 0)
OpenedHandles = new DenseSet<HMODULE>();
- if (!fEnumerateLoadedModules)
- assert(loadDebugHelp() && "These APIs should always be available");
+ if (!fEnumerateLoadedModules) {
+ if (!loadDebugHelp()) {
+ assert(false && "These APIs should always be available");
+ return DynamicLibrary();
+ }
+ }
fEnumerateLoadedModules(GetCurrentProcess(), ELM_Callback, 0);
// Dummy library that represents "search all handles".