aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/LevelRaise.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Transforms/LevelRaise.cpp')
-rw-r--r--lib/Transforms/LevelRaise.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Transforms/LevelRaise.cpp b/lib/Transforms/LevelRaise.cpp
index 2e9d8c2f8c..b2c6b05ab4 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<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...
//