From e1ab2200ffe30467af09140f72ece76708c0eb31 Mon Sep 17 00:00:00 2001 From: Yann Collet Date: Fri, 10 Dec 2021 21:02:17 -0800 Subject: [PATCH] fixed x32 compatibility --- lib/decompress/huf_decompress.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/decompress/huf_decompress.c b/lib/decompress/huf_decompress.c index a00f938c..fa61968b 100644 --- a/lib/decompress/huf_decompress.c +++ b/lib/decompress/huf_decompress.c @@ -172,8 +172,9 @@ static size_t HUF_DecompressAsmArgs_init(HUF_DecompressAsmArgs* args, void* dst, BYTE* const oend = (BYTE*)dst + dstSize; - /* We're assuming x86-64 BMI2 - assure that this is the case. */ - assert(MEM_isLittleEndian() && !MEM_32bits()); + /* The following condition is false on x32 platform, + * but HUF_asm is not compatible with this ABI */ + if (!(MEM_isLittleEndian() && !MEM_32bits())) return 1; /* strict minimum : jump table + 1 byte per stream */ if (srcSize < 10)