From cdeb81d41273220bb35171fe9eeee44f46d8d8b1 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 1 May 2003 21:02:53 +0000 Subject: [PATCH] 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 --- lib/Transforms/LevelRaise.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Transforms/LevelRaise.cpp b/lib/Transforms/LevelRaise.cpp index 2e9d8c2f8c8..b2c6b05ab46 100644 --- a/lib/Transforms/LevelRaise.cpp +++ b/lib/Transforms/LevelRaise.cpp @@ -491,7 +491,8 @@ bool RPR::PeepholeOptimize(BasicBlock *BB, BasicBlock::iterator &BI) { const FunctionType *FTy = cast(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... //