aboutsummaryrefslogtreecommitdiff
path: root/lib/Linker/LinkModules.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Linker/LinkModules.cpp')
-rw-r--r--lib/Linker/LinkModules.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Linker/LinkModules.cpp b/lib/Linker/LinkModules.cpp
index e07629f51b..6f26e95892 100644
--- a/lib/Linker/LinkModules.cpp
+++ b/lib/Linker/LinkModules.cpp
@@ -474,7 +474,7 @@ static bool LinkGlobals(Module *Dest, const Module *Src,
}
// Check to see if may have to link the global with the alias
- if (SGV->hasName() && !SGV->hasInternalLinkage()) {
+ if (!DGV && SGV->hasName() && !SGV->hasInternalLinkage()) {
DGV = Dest->getNamedAlias(SGV->getName());
if (DGV && DGV->getType() != SGV->getType())
// If types don't agree due to opaque types, try to resolve them.