X86SpeculativeLoadHardeningPass::hardenValueInRegister - assert that we have a i8/i16/i32/i64 sized register. NFCI.

Silence static analyzer warning for out-of-range access to the SubRegImms[] array.
This commit is contained in:
Simon Pilgrim 2021-05-15 15:13:28 +01:00
parent e30540a603
commit 73635adb86
1 changed files with 2 additions and 1 deletions

View File

@ -1915,8 +1915,9 @@ unsigned X86SpeculativeLoadHardeningPass::hardenValueInRegister(
auto *RC = MRI->getRegClass(Reg);
int Bytes = TRI->getRegSizeInBits(*RC) / 8;
unsigned StateReg = PS->SSA.GetValueAtEndOfBlock(&MBB);
assert((Bytes == 1 || Bytes == 2 || Bytes == 4 || Bytes == 8) &&
"Unknown register size");
// FIXME: Need to teach this about 32-bit mode.
if (Bytes != 8) {