This patch fixes a potential problem in my previous commit (https://reviews.llvm.org/rL315888) by adding a null check.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315900
91177308-0d34-0410-b5e6-
96231b3b80d8
if (CallMI.isCall() && CallMI.getOperand(0).isGlobal()) {
const Function *CalleeFn =
dyn_cast<Function>(CallMI.getOperand(0).getGlobal());
+ if (!CalleeFn)
+ return false;
const IntegerType *IntTy =
dyn_cast<IntegerType>(CalleeFn->getReturnType());
const AttributeSet &Attrs =