[RISCV][ISel] Attempt to fix UBSan error

Explicitly check an SDValue with the invalid SDValue.

UBSan reports:
runtime error: load of value 36, which is not a valid value for type
'bool'

https://lab.llvm.org/buildbot/#/builders/85/builds/11231
This commit is contained in:
Quentin Colombet 2022-10-05 20:59:28 +00:00
parent c5c2de287e
commit 6bbe7d376e
1 changed files with 3 additions and 1 deletions

View File

@ -8491,7 +8491,9 @@ struct NodeExtensionHelper {
}
/// Check if this operand is compatible with the given vector length \p VL.
bool isVLCompatible(SDValue VL) const { return this->VL && this->VL == VL; }
bool isVLCompatible(SDValue VL) const {
return this->VL != SDValue() && this->VL == VL;
}
/// Check if this operand is compatible with the given \p Mask.
bool isMaskCompatible(SDValue Mask) const {