diff --git a/lib/Linker/LinkModules.cpp b/lib/Linker/LinkModules.cpp index 0d3cc9bfa9f..14e36cc012f 100644 --- a/lib/Linker/LinkModules.cpp +++ b/lib/Linker/LinkModules.cpp @@ -173,7 +173,7 @@ static bool LinkGlobals(Module *Dest, const Module *Src, map &ValueMap, string *Err = 0) { // We will need a module level symbol table if the src module has a module // level symbol table... - SymbolTable *ST = (SymbolTable*)&Src->getSymbolTable(); + SymbolTable *ST = (SymbolTable*)&Dest->getSymbolTable(); // Loop over all of the globals in the src module, mapping them over as we go // @@ -263,7 +263,7 @@ static bool LinkFunctionProtos(Module *Dest, const Module *Src, string *Err = 0) { // We will need a module level symbol table if the src module has a module // level symbol table... - SymbolTable *ST = (SymbolTable*)&Src->getSymbolTable(); + SymbolTable *ST = (SymbolTable*)&Dest->getSymbolTable(); // Loop over all of the functions in the src module, mapping them over as we // go diff --git a/lib/Transforms/Utils/Linker.cpp b/lib/Transforms/Utils/Linker.cpp index 0d3cc9bfa9f..14e36cc012f 100644 --- a/lib/Transforms/Utils/Linker.cpp +++ b/lib/Transforms/Utils/Linker.cpp @@ -173,7 +173,7 @@ static bool LinkGlobals(Module *Dest, const Module *Src, map &ValueMap, string *Err = 0) { // We will need a module level symbol table if the src module has a module // level symbol table... - SymbolTable *ST = (SymbolTable*)&Src->getSymbolTable(); + SymbolTable *ST = (SymbolTable*)&Dest->getSymbolTable(); // Loop over all of the globals in the src module, mapping them over as we go // @@ -263,7 +263,7 @@ static bool LinkFunctionProtos(Module *Dest, const Module *Src, string *Err = 0) { // We will need a module level symbol table if the src module has a module // level symbol table... - SymbolTable *ST = (SymbolTable*)&Src->getSymbolTable(); + SymbolTable *ST = (SymbolTable*)&Dest->getSymbolTable(); // Loop over all of the functions in the src module, mapping them over as we // go diff --git a/lib/VMCore/Linker.cpp b/lib/VMCore/Linker.cpp index 0d3cc9bfa9f..14e36cc012f 100644 --- a/lib/VMCore/Linker.cpp +++ b/lib/VMCore/Linker.cpp @@ -173,7 +173,7 @@ static bool LinkGlobals(Module *Dest, const Module *Src, map &ValueMap, string *Err = 0) { // We will need a module level symbol table if the src module has a module // level symbol table... - SymbolTable *ST = (SymbolTable*)&Src->getSymbolTable(); + SymbolTable *ST = (SymbolTable*)&Dest->getSymbolTable(); // Loop over all of the globals in the src module, mapping them over as we go // @@ -263,7 +263,7 @@ static bool LinkFunctionProtos(Module *Dest, const Module *Src, string *Err = 0) { // We will need a module level symbol table if the src module has a module // level symbol table... - SymbolTable *ST = (SymbolTable*)&Src->getSymbolTable(); + SymbolTable *ST = (SymbolTable*)&Dest->getSymbolTable(); // Loop over all of the functions in the src module, mapping them over as we // go