From: Chris Lattner Date: Thu, 28 Aug 2003 16:42:50 +0000 (+0000) Subject: Fix bug where we considered function types equivalent even if they had differing... X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=841e00b96295a2b66cb7573e961656d28a6cb12b;p=oota-llvm.git Fix bug where we considered function types equivalent even if they had differing numbers of arguments git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8178 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Linker/LinkModules.cpp b/lib/Linker/LinkModules.cpp index 5280c04565f..81d46ca3f44 100644 --- a/lib/Linker/LinkModules.cpp +++ b/lib/Linker/LinkModules.cpp @@ -79,7 +79,9 @@ static bool RecursiveResolveTypesI(const PATypeHolder &DestTy, switch (DestTyT->getPrimitiveID()) { case Type::FunctionTyID: { if (cast(DestTyT)->isVarArg() != - cast(SrcTyT)->isVarArg()) + cast(SrcTyT)->isVarArg() || + cast(DestTyT)->getNumContainedTypes() != + cast(SrcTyT)->getNumContainedTypes()) return true; for (unsigned i = 0, e = getFT(DestTy)->getNumContainedTypes(); i != e; ++i) if (RecursiveResolveTypesI(getFT(DestTy)->getContainedType(i), diff --git a/lib/Transforms/Utils/Linker.cpp b/lib/Transforms/Utils/Linker.cpp index 5280c04565f..81d46ca3f44 100644 --- a/lib/Transforms/Utils/Linker.cpp +++ b/lib/Transforms/Utils/Linker.cpp @@ -79,7 +79,9 @@ static bool RecursiveResolveTypesI(const PATypeHolder &DestTy, switch (DestTyT->getPrimitiveID()) { case Type::FunctionTyID: { if (cast(DestTyT)->isVarArg() != - cast(SrcTyT)->isVarArg()) + cast(SrcTyT)->isVarArg() || + cast(DestTyT)->getNumContainedTypes() != + cast(SrcTyT)->getNumContainedTypes()) return true; for (unsigned i = 0, e = getFT(DestTy)->getNumContainedTypes(); i != e; ++i) if (RecursiveResolveTypesI(getFT(DestTy)->getContainedType(i), diff --git a/lib/VMCore/Linker.cpp b/lib/VMCore/Linker.cpp index 5280c04565f..81d46ca3f44 100644 --- a/lib/VMCore/Linker.cpp +++ b/lib/VMCore/Linker.cpp @@ -79,7 +79,9 @@ static bool RecursiveResolveTypesI(const PATypeHolder &DestTy, switch (DestTyT->getPrimitiveID()) { case Type::FunctionTyID: { if (cast(DestTyT)->isVarArg() != - cast(SrcTyT)->isVarArg()) + cast(SrcTyT)->isVarArg() || + cast(DestTyT)->getNumContainedTypes() != + cast(SrcTyT)->getNumContainedTypes()) return true; for (unsigned i = 0, e = getFT(DestTy)->getNumContainedTypes(); i != e; ++i) if (RecursiveResolveTypesI(getFT(DestTy)->getContainedType(i),