[cfe-commits] r73938 - in /cfe/trunk: lib/CodeGen/CGCall.cpp test/CodeGen/functions.c
Chris Lattner
sabre at nondot.org
Mon Jun 22 18:38:41 PDT 2009
Author: lattner
Date: Mon Jun 22 20:38:41 2009
New Revision: 73938
URL: http://llvm.org/viewvc/llvm-project?rev=73938&view=rev
Log:
fix PR4423.
Modified:
cfe/trunk/lib/CodeGen/CGCall.cpp
cfe/trunk/test/CodeGen/functions.c
Modified: cfe/trunk/lib/CodeGen/CGCall.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGCall.cpp?rev=73938&r1=73937&r2=73938&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGCall.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGCall.cpp Mon Jun 22 20:38:41 2009
@@ -763,7 +763,8 @@
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)) {
Modified: cfe/trunk/test/CodeGen/functions.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/functions.c?rev=73938&r1=73937&r2=73938&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/functions.c (original)
+++ cfe/trunk/test/CodeGen/functions.c Mon Jun 22 20:38:41 2009
@@ -33,3 +33,7 @@
// 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); }
More information about the cfe-commits
mailing list