diff options
author | Chris Lattner <sabre@nondot.org> | 2009-06-23 01:38:41 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-06-23 01:38:41 +0000 |
commit | d6bebbfd510f3b495795b88aafd10ead3cb211e9 (patch) | |
tree | 2149e6ab2a4da82646d4c5b6a5b9eb55de71ba01 | |
parent | fb25052736439d72a557cddd41dfb927bcb3d3e5 (diff) | |
download | clang-d6bebbfd510f3b495795b88aafd10ead3cb211e9.tar.gz |
fix PR4423.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73938 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/CodeGen/CGCall.cpp | 3 | ||||
-rw-r--r-- | test/CodeGen/functions.c | 4 |
2 files changed, 6 insertions, 1 deletions
diff --git a/lib/CodeGen/CGCall.cpp b/lib/CodeGen/CGCall.cpp index ec6058afd9..30c5d28c22 100644 --- a/lib/CodeGen/CGCall.cpp +++ b/lib/CodeGen/CGCall.cpp @@ -763,7 +763,8 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo, if (CE->getOpcode() == llvm::Instruction::BitCast && ActualFT->getReturnType() == CurFT->getReturnType() && - ActualFT->getNumParams() == CurFT->getNumParams()) { + ActualFT->getNumParams() == CurFT->getNumParams() && + ActualFT->getNumParams() == Args.size()) { bool ArgsMatch = true; for (unsigned i = 0, e = ActualFT->getNumParams(); i != e; ++i) if (ActualFT->getParamType(i) != CurFT->getParamType(i)) { diff --git a/test/CodeGen/functions.c b/test/CodeGen/functions.c index 985599216e..12dff1b72c 100644 --- a/test/CodeGen/functions.c +++ b/test/CodeGen/functions.c @@ -33,3 +33,7 @@ void f1() {} // RUN: grep 'define .* @f3' %t | not grep -F '...' struct foo { int X, Y, Z; } f3() { } + +// PR4423 - This shouldn't crash in codegen +void f4() {} +void f5() { f4(42); } |