mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-22 02:33:06 +01:00
[AVR] Fix null dereference warning. NFCI.
We were checking if the ConstantSDNode was null but then immediately dereferencing it afterward - fold these both into a single check. Use the APInt::ult() helper as well. Found by clang static analyzer.
This commit is contained in:
parent
92d68263b1
commit
63f335044d
@ -242,10 +242,7 @@ bool AVRDAGToDAGISel::SelectInlineAsmMemoryOperand(const SDValue &Op,
|
||||
ConstantSDNode *ImmNode = dyn_cast<ConstantSDNode>(ImmOp);
|
||||
|
||||
unsigned Reg;
|
||||
bool CanHandleRegImmOpt = true;
|
||||
|
||||
CanHandleRegImmOpt &= ImmNode != 0;
|
||||
CanHandleRegImmOpt &= ImmNode->getAPIntValue().getZExtValue() < 64;
|
||||
bool CanHandleRegImmOpt = ImmNode && ImmNode->getAPIntValue().ult(64);
|
||||
|
||||
if (CopyFromRegOp->getOpcode() == ISD::CopyFromReg) {
|
||||
RegisterSDNode *RegNode =
|
||||
|
Loading…
Reference in New Issue
Block a user