forked from OSchip/llvm-project
[MIPS] Mips16DAGToDAGISel::selectAddr - Use cast<> instead of dyn_cast<> to avoid dereference of nullptr
The pointer is always dereferenced immediately below, so assert the cast is correct instead of returning nullptr
This commit is contained in:
parent
2bc57d85eb
commit
37ebec68a8
|
@ -121,7 +121,7 @@ bool Mips16DAGToDAGISel::selectAddr(bool SPAllowed, SDValue Addr, SDValue &Base,
|
|||
}
|
||||
// Addresses of the form FI+const or FI|const
|
||||
if (CurDAG->isBaseWithConstantOffset(Addr)) {
|
||||
ConstantSDNode *CN = dyn_cast<ConstantSDNode>(Addr.getOperand(1));
|
||||
auto *CN = cast<ConstantSDNode>(Addr.getOperand(1));
|
||||
if (isInt<16>(CN->getSExtValue())) {
|
||||
// If the first operand is a FI, get the TargetFI Node
|
||||
if (SPAllowed) {
|
||||
|
|
Loading…
Reference in New Issue