forked from OSchip/llvm-project
[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
3cc1f1fc1d
commit
df9ae806bb
|
@ -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