@@ -1430,16 +1430,12 @@ void FilterChooser::emitSingletonTableEntry(DecoderTableInfo &TableInfo,
14301430 unsigned NumBits = Islands[I - 1 ].NumBits ;
14311431 assert (isUInt<8 >(NumBits) && " NumBits overflowed uint8 table entry!" );
14321432 TableInfo.Table .push_back (MCD::OPC_CheckField);
1433- uint8_t Buffer[16 ], *P;
1434- encodeULEB128 (Islands[I - 1 ].StartBit , Buffer);
1435- for (P = Buffer; *P >= 128 ; ++P)
1436- TableInfo.Table .push_back (*P);
1437- TableInfo.Table .push_back (*P);
1433+ uint8_t Buffer[16 ];
1434+ unsigned Len = encodeULEB128 (Islands[I - 1 ].StartBit , Buffer);
1435+ TableInfo.Table .insert (TableInfo.Table .end (), Buffer, Buffer + Len);
14381436 TableInfo.Table .push_back (NumBits);
1439- encodeULEB128 (Islands[I - 1 ].FieldVal , Buffer);
1440- for (P = Buffer; *P >= 128 ; ++P)
1441- TableInfo.Table .push_back (*P);
1442- TableInfo.Table .push_back (*P);
1437+ Len = encodeULEB128 (Islands[I - 1 ].FieldVal , Buffer);
1438+ TableInfo.Table .insert (TableInfo.Table .end (), Buffer, Buffer + Len);
14431439 // Push location for NumToSkip backpatching.
14441440 TableInfo.FixupStack .back ().push_back (TableInfo.Table .size ());
14451441 // The fixup is always 24-bits, so go ahead and allocate the space
@@ -1469,11 +1465,9 @@ void FilterChooser::emitSingletonTableEntry(DecoderTableInfo &TableInfo,
14691465 TableInfo.Table .push_back (HasCompleteDecoder ? MCD::OPC_Decode
14701466 : MCD::OPC_TryDecode);
14711467 NumEncodingsSupported++;
1472- uint8_t Buffer[16 ], *p;
1473- encodeULEB128 (Opc.Opcode , Buffer);
1474- for (p = Buffer; *p >= 128 ; ++p)
1475- TableInfo.Table .push_back (*p);
1476- TableInfo.Table .push_back (*p);
1468+ uint8_t Buffer[16 ];
1469+ unsigned Len = encodeULEB128 (Opc.Opcode , Buffer);
1470+ TableInfo.Table .insert (TableInfo.Table .end (), Buffer, Buffer + Len);
14771471
14781472 SmallString<16 > Bytes;
14791473 raw_svector_ostream S (Bytes);
0 commit comments