forked from OSchip/llvm-project
[ARM] Fix null pointer dereference in CodeGen/ARM/Windows/stack-protector-msvc.ll.test after D64292/r365283
CLI.CS may not be set. llvm-svn: 365299
This commit is contained in:
parent
0464e07c8f
commit
7d63be09b6
|
@ -1981,12 +1981,14 @@ ARMTargetLowering::LowerCall(TargetLowering::CallLoweringInfo &CLI,
|
|||
// more times in this block, we can improve codesize by calling indirectly
|
||||
// as BLXr has a 16-bit encoding.
|
||||
auto *GV = cast<GlobalAddressSDNode>(Callee)->getGlobal();
|
||||
auto *BB = CLI.CS.getParent();
|
||||
PreferIndirect =
|
||||
Subtarget->isThumb() && Subtarget->hasMinSize() &&
|
||||
count_if(GV->users(), [&BB](const User *U) {
|
||||
return isa<Instruction>(U) && cast<Instruction>(U)->getParent() == BB;
|
||||
}) > 2;
|
||||
if (CLI.CS) {
|
||||
auto *BB = CLI.CS.getParent();
|
||||
PreferIndirect = Subtarget->isThumb() && Subtarget->hasMinSize() &&
|
||||
count_if(GV->users(), [&BB](const User *U) {
|
||||
return isa<Instruction>(U) &&
|
||||
cast<Instruction>(U)->getParent() == BB;
|
||||
}) > 2;
|
||||
}
|
||||
}
|
||||
if (isTailCall) {
|
||||
// Check if it's really possible to do a tail call.
|
||||
|
|
Loading…
Reference in New Issue