summaryrefslogtreecommitdiff
path: root/lib/Transforms/IPO
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Transforms/IPO')
-rw-r--r--lib/Transforms/IPO/StructRetPromotion.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Transforms/IPO/StructRetPromotion.cpp b/lib/Transforms/IPO/StructRetPromotion.cpp
index 97a532b8b1..94bf4c6d5f 100644
--- a/lib/Transforms/IPO/StructRetPromotion.cpp
+++ b/lib/Transforms/IPO/StructRetPromotion.cpp
@@ -165,6 +165,10 @@ bool SRETPromotion::isSafeToUpdateAllCallers(Function *F) {
CallSite CS = CallSite::get(*FnUseI);
Instruction *Call = CS.getInstruction();
+ // The function is used by something else than a call or invoke instruction,
+ // we can't change it!
+ if (!Call)
+ return false;
CallSite::arg_iterator AI = CS.arg_begin();
Value *FirstArg = *AI;