Fix bug: LevelRaise/2003-05-01-CallCast.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5975 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Transforms/LevelRaise.cpp b/lib/Transforms/LevelRaise.cpp
index 2e9d8c2..b2c6b05 100644
--- a/lib/Transforms/LevelRaise.cpp
+++ b/lib/Transforms/LevelRaise.cpp
@@ -491,7 +491,8 @@
const FunctionType *FTy = cast<FunctionType>(PTy->getElementType());
// Is the call to a vararg variable with no real parameters?
- if (FTy->isVarArg() && FTy->getNumParams() == 0) {
+ if (FTy->isVarArg() && FTy->getNumParams() == 0 &&
+ !CI->getCalledFunction()) {
// If so, insert a new cast instruction, casting it to a function type
// that matches the current arguments...
//