Fixed issue #52 (faulty binary generation with Visual Studio 2013 & 2015 in release mode (compiler bug)), reported and fixed by Christophe Chevalier (@KrzysFR)
This commit is contained in:
parent
3e8fbabfa8
commit
64e491e688
29
lib/huff0.c
29
lib/huff0.c
@ -1023,17 +1023,22 @@ size_t HUF_readDTableX4 (U32* DTable, const void* src, size_t srcSize)
|
|||||||
U32 nextRankVal = 0;
|
U32 nextRankVal = 0;
|
||||||
U32 w, consumed;
|
U32 w, consumed;
|
||||||
const int rescale = (memLog-tableLog) - 1; /* tableLog <= memLog */
|
const int rescale = (memLog-tableLog) - 1; /* tableLog <= memLog */
|
||||||
|
U32* rankVal0 = rankVal[0];
|
||||||
for (w=1; w<=maxW; w++)
|
for (w=1; w<=maxW; w++)
|
||||||
{
|
{
|
||||||
U32 current = nextRankVal;
|
U32 current = nextRankVal;
|
||||||
nextRankVal += rankStats[w] << (w+rescale);
|
nextRankVal += rankStats[w] << (w+rescale);
|
||||||
rankVal[0][w] = current;
|
rankVal0[w] = current;
|
||||||
|
}
|
||||||
|
for (consumed = minBits; consumed <= memLog - minBits; consumed++)
|
||||||
|
{
|
||||||
|
U32* rankValPtr = rankVal[consumed];
|
||||||
|
for (w = 1; w <= maxW; w++)
|
||||||
|
{
|
||||||
|
rankValPtr[w] = rankVal0[w] >> consumed;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
for (consumed=minBits; consumed <= memLog-minBits; consumed++)
|
|
||||||
for (w=1; w<=maxW; w++)
|
|
||||||
rankVal[consumed][w] = rankVal[0][w] >> consumed;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
HUF_fillDTableX4(dt, memLog,
|
HUF_fillDTableX4(dt, memLog,
|
||||||
sortedSymbol, sizeOfSort,
|
sortedSymbol, sizeOfSort,
|
||||||
@ -1390,15 +1395,21 @@ size_t HUF_readDTableX6 (U32* DTable, const void* src, size_t srcSize)
|
|||||||
U32 nextRankVal = 0;
|
U32 nextRankVal = 0;
|
||||||
U32 w, consumed;
|
U32 w, consumed;
|
||||||
const int rescale = (memLog-tableLog) - 1; /* tableLog <= memLog */
|
const int rescale = (memLog-tableLog) - 1; /* tableLog <= memLog */
|
||||||
|
U32* rankVal0 = rankVal[0];
|
||||||
for (w=1; w<=maxW; w++)
|
for (w=1; w<=maxW; w++)
|
||||||
{
|
{
|
||||||
U32 current = nextRankVal;
|
U32 current = nextRankVal;
|
||||||
nextRankVal += rankStats[w] << (w+rescale);
|
nextRankVal += rankStats[w] << (w+rescale);
|
||||||
rankVal[0][w] = current;
|
rankVal0[w] = current;
|
||||||
|
}
|
||||||
|
for (consumed = minBits; consumed <= memLog - minBits; consumed++)
|
||||||
|
{
|
||||||
|
U32* rankValPtr = rankVal[consumed];
|
||||||
|
for (w = 1; w <= maxW; w++)
|
||||||
|
{
|
||||||
|
rankValPtr[w] = rankVal0[w] >> consumed;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
for (consumed=minBits; consumed <= memLog-minBits; consumed++)
|
|
||||||
for (w=1; w<=maxW; w++)
|
|
||||||
rankVal[consumed][w] = rankVal[0][w] >> consumed;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user