aboutsummaryrefslogtreecommitdiffstats
path: root/lib/VMCore/Linker.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-08-28 16:42:50 +0000
committerChris Lattner <sabre@nondot.org>2003-08-28 16:42:50 +0000
commit841e00b96295a2b66cb7573e961656d28a6cb12b (patch)
treeb174cd6562028e4c5fc2d4db7e3a9d0b4d97834a /lib/VMCore/Linker.cpp
parenta55c4b1ce71bf62b669d5e533544a29739d56a98 (diff)
downloadexternal_llvm-841e00b96295a2b66cb7573e961656d28a6cb12b.zip
external_llvm-841e00b96295a2b66cb7573e961656d28a6cb12b.tar.gz
external_llvm-841e00b96295a2b66cb7573e961656d28a6cb12b.tar.bz2
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
Diffstat (limited to 'lib/VMCore/Linker.cpp')
-rw-r--r--lib/VMCore/Linker.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/VMCore/Linker.cpp b/lib/VMCore/Linker.cpp
index 5280c04..81d46ca 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<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),