mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-28 22:00:30 +00:00
[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
5c30999a59
commit
add569cbc2
@ -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
Block a user