From: Eli Friedman Date: Tue, 29 Nov 2011 01:18:23 +0000 (+0000) Subject: Zap some completely ridiculous code. There's probably a miscompile here, but I don... X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=ba78c883d4c89bd807fa7ebea7ac6f22f3503223;p=oota-llvm.git Zap some completely ridiculous code. There's probably a miscompile here, but I don't really want to try to write a testcase involving an invoke returning a pointer to a varargs function... git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145347 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/InstCombine/InstCombineCalls.cpp b/lib/Transforms/InstCombine/InstCombineCalls.cpp index e8136ab77ff..81dad7e022e 100644 --- a/lib/Transforms/InstCombine/InstCombineCalls.cpp +++ b/lib/Transforms/InstCombine/InstCombineCalls.cpp @@ -960,7 +960,7 @@ Instruction *InstCombiner::visitCallSite(CallSite CS) { PointerType *PTy = cast(Callee->getType()); FunctionType *FTy = cast(PTy->getElementType()); if (FTy->isVarArg()) { - int ix = FTy->getNumParams() + (isa(Callee) ? 2 : 0); + int ix = FTy->getNumParams(); // See if we can optimize any arguments passed through the varargs area of // the call. for (CallSite::arg_iterator I = CS.arg_begin()+FTy->getNumParams(),