Fix unaligned data in self test
AltiVec and Power8 are brutal. The SIMD units just mask-off the lower 3 address bits. They make the buffer aligned whethere it is aligned or notpull/489/head
parent
b9e871d1e8
commit
e7974c7915
12
validat0.cpp
12
validat0.cpp
|
|
@ -2467,16 +2467,16 @@ bool TestHuffmanCodes()
|
|||
{
|
||||
try
|
||||
{
|
||||
byte data1[0xfff]; // Place on stack, avoid new
|
||||
unsigned int data2[0xff];
|
||||
SecByteBlock data1(0xfff);
|
||||
SecBlock<word32> data2(0xff);
|
||||
|
||||
unsigned int len1 = GlobalRNG().GenerateWord32(4, 0xfff);
|
||||
GlobalRNG().GenerateBlock(data1, len1);
|
||||
GlobalRNG().GenerateBlock(data1.BytePtr(), data1.SizeInBytes());
|
||||
unsigned int len2 = GlobalRNG().GenerateWord32(4, 0xff);
|
||||
GlobalRNG().GenerateBlock((byte*)data2, len2*sizeof(unsigned int));
|
||||
GlobalRNG().GenerateBlock(data2.BytePtr(), data2.SizeInBytes());
|
||||
|
||||
ArraySource source(data1, len1, false);
|
||||
HuffmanDecoder decoder(data2, len2);
|
||||
ArraySource source(data1.BytePtr(), data1.SizeInBytes(), false);
|
||||
HuffmanDecoder decoder(data2.begin(), data2.size());
|
||||
|
||||
LowFirstBitReader reader(source);
|
||||
unsigned int val;
|
||||
|
|
|
|||
Loading…
Reference in New Issue