天天看點

zlib 1.2.11 debug版正常,release版崩潰

這情況真TM無語。

最後通過搜尋發現是inffast.c 這個檔案的問題。

/* inffast.c -- fast decoding
 * Copyright (C) 1995-2017 Mark Adler
 * For conditions of distribution and use, see copyright notice in zlib.h
 */

#include "zutil.h"
#include "inftrees.h"
#include "inflate.h"
#include "inffast.h"

#ifdef ASMINF
#  pragma message("Assembler code may have bugs -- use at your own risk")
#else
           

因為release版解壓縮啟用了彙編代碼,而debug版沒有。是以才會出現這個問題。

解決辦法:

zlib 1.2.11 debug版正常,release版崩潰

去掉後邊兩個預編譯選項。

繼續閱讀