Avoid Undefined Behavior in Match Ptr Calculation
This commit is contained in:
@@ -99,10 +99,10 @@ size_t ZSTD_compressBlock_fast_generic(
|
|||||||
U32 const matchIndex = hashTable[h];
|
U32 const matchIndex = hashTable[h];
|
||||||
const BYTE* match = base + matchIndex;
|
const BYTE* match = base + matchIndex;
|
||||||
const U32 repIndex = current + 1 - offset_1;
|
const U32 repIndex = current + 1 - offset_1;
|
||||||
const BYTE* repBase = (dictMode == ZSTD_dictMatchState
|
const BYTE* repMatch = (dictMode == ZSTD_dictMatchState
|
||||||
&& repIndex < prefixLowestIndex) ?
|
&& repIndex < prefixLowestIndex) ?
|
||||||
dictBase - dictIndexDelta : base;
|
dictBase + (repIndex - dictIndexDelta) :
|
||||||
const BYTE* repMatch = repBase + repIndex;
|
base + repIndex;
|
||||||
hashTable[h] = current; /* update hash table */
|
hashTable[h] = current; /* update hash table */
|
||||||
|
|
||||||
if (dictMode == ZSTD_dictMatchState
|
if (dictMode == ZSTD_dictMatchState
|
||||||
|
|||||||
Reference in New Issue
Block a user