Fix bug where we considered function types equivalent even if they had differing...
authorChris Lattner <sabre@nondot.org>
Thu, 28 Aug 2003 16:42:50 +0000 (16:42 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 28 Aug 2003 16:42:50 +0000 (16:42 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8178 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Linker/LinkModules.cpp
lib/Transforms/Utils/Linker.cpp
lib/VMCore/Linker.cpp

index 5280c04565f3f7fe6a004bb4fbcc9fde841641c6..81d46ca3f44f28f8f1695a5a3d89fba66a4a71da 100644 (file)
@@ -79,7 +79,9 @@ static bool RecursiveResolveTypesI(const PATypeHolder &DestTy,
   switch (DestTyT->getPrimitiveID()) {
   case Type::FunctionTyID: {
     if (cast<FunctionType>(DestTyT)->isVarArg() !=
-        cast<FunctionType>(SrcTyT)->isVarArg())
+        cast<FunctionType>(SrcTyT)->isVarArg() ||
+        cast<FunctionType>(DestTyT)->getNumContainedTypes() !=
+        cast<FunctionType>(SrcTyT)->getNumContainedTypes())
       return true;
     for (unsigned i = 0, e = getFT(DestTy)->getNumContainedTypes(); i != e; ++i)
       if (RecursiveResolveTypesI(getFT(DestTy)->getContainedType(i),
index 5280c04565f3f7fe6a004bb4fbcc9fde841641c6..81d46ca3f44f28f8f1695a5a3d89fba66a4a71da 100644 (file)
@@ -79,7 +79,9 @@ static bool RecursiveResolveTypesI(const PATypeHolder &DestTy,
   switch (DestTyT->getPrimitiveID()) {
   case Type::FunctionTyID: {
     if (cast<FunctionType>(DestTyT)->isVarArg() !=
-        cast<FunctionType>(SrcTyT)->isVarArg())
+        cast<FunctionType>(SrcTyT)->isVarArg() ||
+        cast<FunctionType>(DestTyT)->getNumContainedTypes() !=
+        cast<FunctionType>(SrcTyT)->getNumContainedTypes())
       return true;
     for (unsigned i = 0, e = getFT(DestTy)->getNumContainedTypes(); i != e; ++i)
       if (RecursiveResolveTypesI(getFT(DestTy)->getContainedType(i),
index 5280c04565f3f7fe6a004bb4fbcc9fde841641c6..81d46ca3f44f28f8f1695a5a3d89fba66a4a71da 100644 (file)
@@ -79,7 +79,9 @@ static bool RecursiveResolveTypesI(const PATypeHolder &DestTy,
   switch (DestTyT->getPrimitiveID()) {
   case Type::FunctionTyID: {
     if (cast<FunctionType>(DestTyT)->isVarArg() !=
-        cast<FunctionType>(SrcTyT)->isVarArg())
+        cast<FunctionType>(SrcTyT)->isVarArg() ||
+        cast<FunctionType>(DestTyT)->getNumContainedTypes() !=
+        cast<FunctionType>(SrcTyT)->getNumContainedTypes())
       return true;
     for (unsigned i = 0, e = getFT(DestTy)->getNumContainedTypes(); i != e; ++i)
       if (RecursiveResolveTypesI(getFT(DestTy)->getContainedType(i),