diff options
Diffstat (limited to 'lib/Transforms/Scalar/SCCP.cpp')
-rw-r--r-- | lib/Transforms/Scalar/SCCP.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Transforms/Scalar/SCCP.cpp b/lib/Transforms/Scalar/SCCP.cpp index e28478c256..aa63ca72cc 100644 --- a/lib/Transforms/Scalar/SCCP.cpp +++ b/lib/Transforms/Scalar/SCCP.cpp @@ -1717,7 +1717,8 @@ static bool AddressIsTaken(const GlobalValue *GV) { return true; // Storing addr of GV. } else if (isa<InvokeInst>(U) || isa<CallInst>(U)) { // Make sure we are calling the function, not passing the address. - if (UI.getOperandNo() != 0) + CallSite CS((Instruction*)U); + if (!CS.isCallee(UI)) return true; } else if (const LoadInst *LI = dyn_cast<LoadInst>(U)) { if (LI->isVolatile()) |