]> granicus.if.org Git - llvm/commitdiff
Remove a bad cast in CloneModule()
authorMichael Kuperstein <michael.m.kuperstein@intel.com>
Tue, 23 Dec 2014 08:23:45 +0000 (08:23 +0000)
committerMichael Kuperstein <michael.m.kuperstein@intel.com>
Tue, 23 Dec 2014 08:23:45 +0000 (08:23 +0000)
A cast that was introduced in r209007 was accidentally left in after the changes made to GlobalAlias rules in r210062. This crashes if the aliasee is a now-leggal ConstantExpr.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224756 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Utils/CloneModule.cpp

index d05d25164cdf12089d70c5ad8bb46910abaad5d5..fae9ff5bce0f35563d9d6b54a51270625dad7238 100644 (file)
@@ -109,7 +109,7 @@ Module *llvm::CloneModule(const Module *M, ValueToValueMapTy &VMap) {
        I != E; ++I) {
     GlobalAlias *GA = cast<GlobalAlias>(VMap[I]);
     if (const Constant *C = I->getAliasee())
-      GA->setAliasee(cast<GlobalObject>(MapValue(C, VMap)));
+      GA->setAliasee(MapValue(C, VMap));
   }
 
   // And named metadata....