@@ -688,7 +688,7 @@ static void resolveTableFixups(DecoderTable &Table, const FixupList &Fixups,
688
688
uint32_t Delta = DestIdx - FixupIdx - 3 ;
689
689
// Our NumToSkip entries are 24-bits. Make sure our table isn't too
690
690
// big.
691
- assert (Delta < ( 1u << 24 ));
691
+ assert (isUInt< 24 >(Delta ));
692
692
Table[FixupIdx] = (uint8_t )Delta;
693
693
Table[FixupIdx + 1 ] = (uint8_t )(Delta >> 8 );
694
694
Table[FixupIdx + 2 ] = (uint8_t )(Delta >> 16 );
@@ -698,7 +698,7 @@ static void resolveTableFixups(DecoderTable &Table, const FixupList &Fixups,
698
698
// Emit table entries to decode instructions given a segment or segments
699
699
// of bits.
700
700
void Filter::emitTableEntry (DecoderTableInfo &TableInfo) const {
701
- assert ((NumBits < ( 1u << 8 ) ) && " NumBits overflowed uint8 table entry!" );
701
+ assert (isUInt< 8 >(NumBits ) && " NumBits overflowed uint8 table entry!" );
702
702
TableInfo.Table .push_back (MCD::OPC_ExtractField);
703
703
704
704
SmallString<16 > SBytes;
@@ -753,8 +753,7 @@ void Filter::emitTableEntry(DecoderTableInfo &TableInfo) const {
753
753
// two as to account for the width of the NumToSkip field itself.
754
754
if (PrevFilter) {
755
755
uint32_t NumToSkip = Table.size () - PrevFilter - 3 ;
756
- assert (NumToSkip < (1u << 24 ) &&
757
- " disassembler decoding table too large!" );
756
+ assert (isUInt<24 >(NumToSkip) && " disassembler decoding table too large!" );
758
757
Table[PrevFilter] = (uint8_t )NumToSkip;
759
758
Table[PrevFilter + 1 ] = (uint8_t )(NumToSkip >> 8 );
760
759
Table[PrevFilter + 2 ] = (uint8_t )(NumToSkip >> 16 );
@@ -1446,7 +1445,7 @@ void FilterChooser::emitSingletonTableEntry(DecoderTableInfo &TableInfo,
1446
1445
// Check any additional encoding fields needed.
1447
1446
for (unsigned I = Size; I != 0 ; --I) {
1448
1447
unsigned NumBits = EndBits[I - 1 ] - StartBits[I - 1 ] + 1 ;
1449
- assert ((NumBits < ( 1u << 8 ) ) && " NumBits overflowed uint8 table entry!" );
1448
+ assert (isUInt< 8 >(NumBits ) && " NumBits overflowed uint8 table entry!" );
1450
1449
TableInfo.Table .push_back (MCD::OPC_CheckField);
1451
1450
uint8_t Buffer[16 ], *P;
1452
1451
encodeULEB128 (StartBits[I - 1 ], Buffer);
0 commit comments