Commit 753494b8 authored by Andre Maroneze's avatar Andre Maroneze 💬
Browse files

[miniz] update code from upstream (https://github.com/richgel999/miniz)

parent 7ed51c66
......@@ -310,48 +310,48 @@ directory file line function property kind status property
. miniz_zip.c 1607 mz_zip_reader_extract_to_heap mem_access Unknown \valid_read((mz_uint32 const *)(p + MZ_ZIP_CDH_DECOMPRESSED_SIZE_OFS))
. miniz_zip.c 1616 mz_zip_reader_extract_to_heap function_pointer Unknown \valid_function(pZip->m_pAlloc)
. miniz_zip.c 1624 mz_zip_reader_extract_to_heap function_pointer Unknown \valid_function(pZip->m_pFree)
. miniz_zip.c 2660 mz_zip_writer_end_internal initialization Unknown \initialized(&pState->m_pFile)
. miniz_zip.c 2664 mz_zip_writer_end_internal precondition of fclose Unknown valid_stream: \valid(stream)
. miniz_zip.c 2721 mz_zip_writer_init_v2 precondition of memset Unknown valid_s: valid_or_empty(s, n)
. miniz_zip.c 2723 mz_zip_writer_init_v2 mem_access Unknown \valid(&(pZip->m_pState)->m_central_dir.m_element_size)
. miniz_zip.c 2778 mz_zip_file_write_func initialization Unknown \initialized(&(pZip->m_pState)->m_pFile)
. miniz_zip.c 2778 mz_zip_file_write_func mem_access Unknown \valid_read(&pZip->m_pState)
. miniz_zip.c 2778 mz_zip_file_write_func precondition of ftello Unknown valid_stream: \valid(stream)
. miniz_zip.c 2780 mz_zip_file_write_func initialization Unknown \initialized(&(pZip->m_pState)->m_file_archive_start_ofs)
. miniz_zip.c 2782 mz_zip_file_write_func precondition of fseeko Unknown valid_stream: \valid(stream)
. miniz_zip.c 2788 mz_zip_file_write_func precondition of fwrite Unknown valid_ptr_block: \valid_read((char *)ptr + (0 .. nmemb * size - 1))
. miniz_zip.c 2788 mz_zip_file_write_func precondition of fwrite Unknown valid_stream: \valid(stream)
. miniz_zip.c 2817 mz_zip_writer_init_file_v2 mem_access Unknown \valid(&(pZip->m_pState)->m_pFile)
. miniz_zip.c 2879 mz_zip_writer_init_from_reader_v2 initialization Unknown \initialized(&(pZip->m_pState)->m_zip64)
. miniz_zip.c 2895 mz_zip_writer_init_from_reader_v2 initialization Unknown \initialized(&pState->m_pFile)
. miniz_zip.c 2910 mz_zip_writer_init_from_reader_v2 precondition of freopen Unknown valid_stream: \valid(stream)
. miniz_zip.c 2922 mz_zip_writer_init_from_reader_v2 initialization Unknown \initialized(&pState->m_pMem)
. miniz_zip.c 3068 mz_zip_writer_add_to_central_dir initialization Unknown \initialized(&pState->m_central_dir.m_size)
. miniz_zip.c 3072 mz_zip_writer_add_to_central_dir initialization Unknown \initialized(&(pZip->m_pState)->m_zip64)
. miniz_zip.c 3103 mz_zip_writer_validate_archive_name initialization Unknown \initialized(pArchive_name)
. miniz_zip.c 3176 mz_zip_writer_add_mem_ex_v2 initialization Unknown \initialized(&pState->m_zip64)
. miniz_zip.c 3225 mz_zip_writer_add_mem_ex_v2 precondition of strlen Unknown valid_string_s: valid_read_string(s)
. miniz_zip.c 3232 mz_zip_writer_add_mem_ex_v2 initialization Unknown \initialized(&pState->m_central_dir.m_size)
. miniz_zip.c 3235 mz_zip_writer_add_mem_ex_v2 initialization Unknown \initialized(&pState->m_zip64)
. miniz_zip.c 3248 mz_zip_writer_add_mem_ex_v2 initialization Unknown \initialized(pArchive_name + (unsigned long)(archive_name_size - 1))
. miniz_zip.c 3259 mz_zip_writer_add_mem_ex_v2 initialization Unknown \initialized(&pState->m_zip64)
. miniz_zip.c 3264 mz_zip_writer_add_mem_ex_v2 function_pointer Unknown \valid_function(pZip->m_pAlloc)
. miniz_zip.c 3300 mz_zip_writer_add_mem_ex_v2 function_pointer Unknown \valid_function(pZip->m_pWrite)
. miniz_zip.c 3307 mz_zip_writer_add_mem_ex_v2 function_pointer Unknown \valid_function(pZip->m_pFree)
. miniz_zip.c 3327 mz_zip_writer_add_mem_ex_v2 function_pointer Unknown \valid_function(pZip->m_pWrite)
. miniz_zip.c 3334 mz_zip_writer_add_mem_ex_v2 function_pointer Unknown \valid_function(pZip->m_pFree)
. miniz_zip.c 3352 mz_zip_writer_add_mem_ex_v2 function_pointer Unknown \valid_function(pZip->m_pFree)
. miniz_zip.c 3378 mz_zip_writer_add_mem_ex_v2 function_pointer Unknown \valid_function(pZip->m_pFree)
. miniz_zip.c 4236 mz_zip_writer_finalize_archive initialization Unknown \initialized(&pState->m_zip64)
. miniz_zip.c 4238 mz_zip_writer_finalize_archive initialization Unknown \initialized(&pState->m_central_dir.m_size)
. miniz_zip.c 4243 mz_zip_writer_finalize_archive initialization Unknown \initialized(&pState->m_central_dir.m_size)
. miniz_zip.c 4253 mz_zip_writer_finalize_archive initialization Unknown \initialized(&pState->m_central_dir.m_size)
. miniz_zip.c 4255 mz_zip_writer_finalize_archive dangling_pointer Unknown ¬\dangling(&pState->m_central_dir.m_p)
. miniz_zip.c 4255 mz_zip_writer_finalize_archive function_pointer Unknown \valid_function(pZip->m_pWrite)
. miniz_zip.c 4255 mz_zip_writer_finalize_archive initialization Unknown \initialized(&pState->m_central_dir.m_p)
. miniz_zip.c 4275 mz_zip_writer_finalize_archive function_pointer Unknown \valid_function(pZip->m_pWrite)
. miniz_zip.c 4299 mz_zip_writer_finalize_archive function_pointer Unknown \valid_function(pZip->m_pWrite)
. miniz_zip.c 4303 mz_zip_writer_finalize_archive initialization Unknown \initialized(&pState->m_pFile)
. miniz_zip.c 2669 mz_zip_writer_end_internal initialization Unknown \initialized(&pState->m_pFile)
. miniz_zip.c 2673 mz_zip_writer_end_internal precondition of fclose Unknown valid_stream: \valid(stream)
. miniz_zip.c 2730 mz_zip_writer_init_v2 precondition of memset Unknown valid_s: valid_or_empty(s, n)
. miniz_zip.c 2732 mz_zip_writer_init_v2 mem_access Unknown \valid(&(pZip->m_pState)->m_central_dir.m_element_size)
. miniz_zip.c 2787 mz_zip_file_write_func initialization Unknown \initialized(&(pZip->m_pState)->m_pFile)
. miniz_zip.c 2787 mz_zip_file_write_func mem_access Unknown \valid_read(&pZip->m_pState)
. miniz_zip.c 2787 mz_zip_file_write_func precondition of ftello Unknown valid_stream: \valid(stream)
. miniz_zip.c 2789 mz_zip_file_write_func initialization Unknown \initialized(&(pZip->m_pState)->m_file_archive_start_ofs)
. miniz_zip.c 2791 mz_zip_file_write_func precondition of fseeko Unknown valid_stream: \valid(stream)
. miniz_zip.c 2797 mz_zip_file_write_func precondition of fwrite Unknown valid_ptr_block: \valid_read((char *)ptr + (0 .. nmemb * size - 1))
. miniz_zip.c 2797 mz_zip_file_write_func precondition of fwrite Unknown valid_stream: \valid(stream)
. miniz_zip.c 2826 mz_zip_writer_init_file_v2 mem_access Unknown \valid(&(pZip->m_pState)->m_pFile)
. miniz_zip.c 2888 mz_zip_writer_init_from_reader_v2 initialization Unknown \initialized(&(pZip->m_pState)->m_zip64)
. miniz_zip.c 2904 mz_zip_writer_init_from_reader_v2 initialization Unknown \initialized(&pState->m_pFile)
. miniz_zip.c 2919 mz_zip_writer_init_from_reader_v2 precondition of freopen Unknown valid_stream: \valid(stream)
. miniz_zip.c 2931 mz_zip_writer_init_from_reader_v2 initialization Unknown \initialized(&pState->m_pMem)
. miniz_zip.c 3077 mz_zip_writer_add_to_central_dir initialization Unknown \initialized(&pState->m_central_dir.m_size)
. miniz_zip.c 3081 mz_zip_writer_add_to_central_dir initialization Unknown \initialized(&(pZip->m_pState)->m_zip64)
. miniz_zip.c 3112 mz_zip_writer_validate_archive_name initialization Unknown \initialized(pArchive_name)
. miniz_zip.c 3185 mz_zip_writer_add_mem_ex_v2 initialization Unknown \initialized(&pState->m_zip64)
. miniz_zip.c 3234 mz_zip_writer_add_mem_ex_v2 precondition of strlen Unknown valid_string_s: valid_read_string(s)
. miniz_zip.c 3241 mz_zip_writer_add_mem_ex_v2 initialization Unknown \initialized(&pState->m_central_dir.m_size)
. miniz_zip.c 3244 mz_zip_writer_add_mem_ex_v2 initialization Unknown \initialized(&pState->m_zip64)
. miniz_zip.c 3257 mz_zip_writer_add_mem_ex_v2 initialization Unknown \initialized(pArchive_name + (unsigned long)(archive_name_size - 1))
. miniz_zip.c 3268 mz_zip_writer_add_mem_ex_v2 initialization Unknown \initialized(&pState->m_zip64)
. miniz_zip.c 3273 mz_zip_writer_add_mem_ex_v2 function_pointer Unknown \valid_function(pZip->m_pAlloc)
. miniz_zip.c 3309 mz_zip_writer_add_mem_ex_v2 function_pointer Unknown \valid_function(pZip->m_pWrite)
. miniz_zip.c 3316 mz_zip_writer_add_mem_ex_v2 function_pointer Unknown \valid_function(pZip->m_pFree)
. miniz_zip.c 3336 mz_zip_writer_add_mem_ex_v2 function_pointer Unknown \valid_function(pZip->m_pWrite)
. miniz_zip.c 3343 mz_zip_writer_add_mem_ex_v2 function_pointer Unknown \valid_function(pZip->m_pFree)
. miniz_zip.c 3361 mz_zip_writer_add_mem_ex_v2 function_pointer Unknown \valid_function(pZip->m_pFree)
. miniz_zip.c 3387 mz_zip_writer_add_mem_ex_v2 function_pointer Unknown \valid_function(pZip->m_pFree)
. miniz_zip.c 4255 mz_zip_writer_finalize_archive initialization Unknown \initialized(&pState->m_zip64)
. miniz_zip.c 4257 mz_zip_writer_finalize_archive initialization Unknown \initialized(&pState->m_central_dir.m_size)
. miniz_zip.c 4262 mz_zip_writer_finalize_archive initialization Unknown \initialized(&pState->m_central_dir.m_size)
. miniz_zip.c 4272 mz_zip_writer_finalize_archive initialization Unknown \initialized(&pState->m_central_dir.m_size)
. miniz_zip.c 4274 mz_zip_writer_finalize_archive dangling_pointer Unknown ¬\dangling(&pState->m_central_dir.m_p)
. miniz_zip.c 4274 mz_zip_writer_finalize_archive function_pointer Unknown \valid_function(pZip->m_pWrite)
. miniz_zip.c 4274 mz_zip_writer_finalize_archive initialization Unknown \initialized(&pState->m_central_dir.m_p)
. miniz_zip.c 4294 mz_zip_writer_finalize_archive function_pointer Unknown \valid_function(pZip->m_pWrite)
. miniz_zip.c 4318 mz_zip_writer_finalize_archive function_pointer Unknown \valid_function(pZip->m_pWrite)
. miniz_zip.c 4322 mz_zip_writer_finalize_archive initialization Unknown \initialized(&pState->m_pFile)
FRAMAC_SHARE/libc assert.h 31 __FC_assert precondition Unknown nonnull_c: c ≢ 0
FRAMAC_SHARE/libc stdio.h 120 fclose precondition Unknown valid_stream: \valid(stream)
FRAMAC_SHARE/libc stdio.h 173 freopen precondition Unknown valid_stream: \valid(stream)
......
......@@ -15,9 +15,9 @@ Unreached functions (16) =
<miniz_zip.c>: mz_zip_heap_write_func; mz_zip_writer_add_put_buf_callback;
[metrics] References to non-analyzed functions
------------------------------------
Function mz_zip_writer_add_mem_ex_v2 references mz_zip_writer_add_put_buf_callback (at miniz_zip.c:3367)
Function mz_zip_writer_end_internal references mz_zip_heap_write_func (at miniz_zip.c:2676)
Function mz_zip_writer_init_from_reader_v2 references mz_zip_heap_write_func (at miniz_zip.c:2929)
Function mz_zip_writer_add_mem_ex_v2 references mz_zip_writer_add_put_buf_callback (at miniz_zip.c:3376)
Function mz_zip_writer_end_internal references mz_zip_heap_write_func (at miniz_zip.c:2685)
Function mz_zip_writer_init_from_reader_v2 references mz_zip_heap_write_func (at miniz_zip.c:2938)
Function tdefl_compress calls tdefl_flush_output_buffer (at miniz_tdef.c:1280)
Function tdefl_compress calls tdefl_compress_fast (at miniz_tdef.c:1287)
Function tdefl_compress calls mz_adler32 (at miniz_tdef.c:1298)
......@@ -29,7 +29,7 @@ Function tdefl_compress_normal calls tdefl_record_match (at miniz_tdef.c:1196)
Function tdefl_compress_normal calls tdefl_flush_block (at miniz_tdef.c:1217)
[metrics] Statements analyzed by Eva
--------------------------
4017 stmts in analyzed functions, 2311 stmts analyzed (57.5%)
4022 stmts in analyzed functions, 2311 stmts analyzed (57.5%)
TDEFL_READ_UNALIGNED_WORD: 2 stmts out of 2 (100.0%)
TDEFL_READ_UNALIGNED_WORD2: 2 stmts out of 2 (100.0%)
eva_main: 13 stmts out of 13 (100.0%)
......@@ -102,4 +102,4 @@ tdefl_compress_normal: 58 stmts out of 166 (34.9%)
mz_zip_writer_write_zeros: 8 stmts out of 24 (33.3%)
tdefl_compress: 32 stmts out of 103 (31.1%)
tdefl_find_match: 29 stmts out of 142 (20.4%)
tinfl_decompress: 11 stmts out of 1120 (1.0%)
tinfl_decompress: 11 stmts out of 1125 (1.0%)
......@@ -2,20 +2,20 @@ miniz_tdef.c:1043:[nonterm:stmt] warning: non-terminating statement
stack: tdefl_record_literal :: miniz_tdef.c:1193 <-
tdefl_compress_normal :: miniz_tdef.c:1293 <-
tdefl_compress :: miniz_tdef.c:1319 <-
tdefl_compress_buffer :: miniz_zip.c:3368 <-
mz_zip_writer_add_mem_ex_v2 :: miniz_zip.c:3139 <-
mz_zip_writer_add_mem_ex :: miniz_zip.c:4409 <-
mz_zip_add_mem_to_archive_file_in_place_v2 :: miniz_zip.c:4346 <-
tdefl_compress_buffer :: miniz_zip.c:3377 <-
mz_zip_writer_add_mem_ex_v2 :: miniz_zip.c:3148 <-
mz_zip_writer_add_mem_ex :: miniz_zip.c:4428 <-
mz_zip_add_mem_to_archive_file_in_place_v2 :: miniz_zip.c:4365 <-
mz_zip_add_mem_to_archive_file_in_place :: examples/example2.c:64 <-
main :: stubs.c:21 <-
eva_main
miniz_tdef.c:1088:[nonterm:stmt] warning: non-terminating loop
stack: tdefl_compress_normal :: miniz_tdef.c:1293 <-
tdefl_compress :: miniz_tdef.c:1319 <-
tdefl_compress_buffer :: miniz_zip.c:3368 <-
mz_zip_writer_add_mem_ex_v2 :: miniz_zip.c:3139 <-
mz_zip_writer_add_mem_ex :: miniz_zip.c:4409 <-
mz_zip_add_mem_to_archive_file_in_place_v2 :: miniz_zip.c:4346 <-
tdefl_compress_buffer :: miniz_zip.c:3377 <-
mz_zip_writer_add_mem_ex_v2 :: miniz_zip.c:3148 <-
mz_zip_writer_add_mem_ex :: miniz_zip.c:4428 <-
mz_zip_add_mem_to_archive_file_in_place_v2 :: miniz_zip.c:4365 <-
mz_zip_add_mem_to_archive_file_in_place :: examples/example2.c:64 <-
main :: stubs.c:21 <-
eva_main
......
miniz_zip.c:2910:[eva:garbled-mix] warning: The specification of function freopen has generated a garbled mix for assigns clause *stream.
miniz_zip.c:2782:[eva:garbled-mix] warning: The specification of function fseeko has generated a garbled mix for assigns clause *stream.
miniz_zip.c:2788:[eva:garbled-mix] warning: The specification of function fwrite has generated a garbled mix for assigns clause *stream.
miniz_zip.c:4303:[eva:garbled-mix] warning: The specification of function fflush has generated a garbled mix for assigns clause *stream.
miniz_zip.c:4303:[eva:garbled-mix] warning: The specification of function fflush has generated a garbled mix for assigns clause __fc_fopen[
miniz_zip.c:2919:[eva:garbled-mix] warning: The specification of function freopen has generated a garbled mix for assigns clause *stream.
miniz_zip.c:2791:[eva:garbled-mix] warning: The specification of function fseeko has generated a garbled mix for assigns clause *stream.
miniz_zip.c:2797:[eva:garbled-mix] warning: The specification of function fwrite has generated a garbled mix for assigns clause *stream.
miniz_zip.c:4322:[eva:garbled-mix] warning: The specification of function fflush has generated a garbled mix for assigns clause *stream.
miniz_zip.c:4322:[eva:garbled-mix] warning: The specification of function fflush has generated a garbled mix for assigns clause __fc_fopen[
0 .. 16 - 1].
miniz_zip.c:998:[eva:garbled-mix] warning: The specification of function fseeko has generated a garbled mix for assigns clause *stream.
miniz_zip.c:972:[eva:garbled-mix] warning: The specification of function fseeko has generated a garbled mix for assigns clause *stream.
......
......@@ -67,7 +67,7 @@
mz_zip_reader_locate_header_sig (1 call);
mz_zip_reader_read_central_dir (4 calls);
mz_zip_reader_sort_central_dir_offsets_by_filename (1 call);
mz_zip_set_error (256 calls); mz_zip_set_file_times (1 call);
mz_zip_set_error (257 calls); mz_zip_set_file_times (1 call);
mz_zip_set_last_error (1 call); mz_zip_string_equal (2 calls);
mz_zip_time_t_to_dos_time (3 calls); mz_zip_validate_archive (2 calls);
mz_zip_validate_file (1 call); mz_zip_validate_file_archive (0 call);
......@@ -157,15 +157,15 @@ Potential entry points (55)
Global metrics
==============
Sloc = 8478
Decision point = 1622
Sloc = 8468
Decision point = 1624
Global variables = 22
If = 1558
If = 1560
Loop = 211
Goto = 660
Assignment = 3859
Goto = 664
Assignment = 3849
Exit point = 179
Function = 179
Function call = 991
Pointer dereferencing = 2782
Cyclomatic complexity = 1801
Function call = 993
Pointer dereferencing = 2785
Cyclomatic complexity = 1803
......@@ -11,7 +11,7 @@ Unreached functions (1) =
Function main calls mz_inflateEnd (at examples/example3.c:246)
[metrics] Statements analyzed by Eva
--------------------------
3726 stmts in analyzed functions, 2306 stmts analyzed (61.9%)
3731 stmts in analyzed functions, 2306 stmts analyzed (61.8%)
TDEFL_READ_UNALIGNED_WORD: 2 stmts out of 2 (100.0%)
TDEFL_READ_UNALIGNED_WORD2: 2 stmts out of 2 (100.0%)
TDEFL_READ_UNALIGNED_WORD32: 2 stmts out of 2 (100.0%)
......@@ -46,4 +46,4 @@ mz_deflate: 55 stmts out of 72 (76.4%)
mz_deflateEnd: 6 stmts out of 9 (66.7%)
mz_deflateInit2: 27 stmts out of 47 (57.4%)
mz_inflate: 28 stmts out of 140 (20.0%)
tinfl_decompress: 11 stmts out of 1120 (1.0%)
tinfl_decompress: 11 stmts out of 1125 (1.0%)
......@@ -7755,13 +7755,19 @@ tinfl_status __attribute__((__visibility__("default"))) tinfl_decompress
dist += extra_bits_0;
}
dist_from_out_buf_start = (unsigned long)(pOut_buf_cur - pOut_buf_start);
if ((size_t)dist > dist_from_out_buf_start)
if (decomp_flags & (unsigned int)TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF)
while (1) {
status = TINFL_STATUS_FAILED;
r->m_state = (unsigned int)37;
goto common_exit;
case (mz_uint32)37: ;
if (dist == (mz_uint32)0) goto _LOR_1;
else
if ((size_t)dist > dist_from_out_buf_start) goto _LOR_1;
else
if (dist_from_out_buf_start == (size_t)0) {
_LOR_1: ;
if (decomp_flags & (unsigned int)TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF)
while (1) {
status = TINFL_STATUS_FAILED;
r->m_state = (unsigned int)37;
goto common_exit;
case (mz_uint32)37: ;
}
}
pSrc = pOut_buf_start + ((dist_from_out_buf_start - (size_t)dist) & out_buf_size_mask);
if (pOut_buf_cur > pSrc) tmp_43 = pOut_buf_cur;
......
......@@ -58,15 +58,15 @@ Potential entry points (21)
Global metrics
==============
Sloc = 4175
Decision point = 725
Sloc = 4180
Decision point = 727
Global variables = 21
If = 692
If = 694
Loop = 180
Goto = 181
Goto = 183
Assignment = 2013
Exit point = 64
Function = 64
Function call = 256
Pointer dereferencing = 1479
Cyclomatic complexity = 789
Cyclomatic complexity = 791
......@@ -11,8 +11,8 @@ Unreached functions (1) =
Function main references tinfl_put_buf_func (at examples/example4.c:82)
[metrics] Statements analyzed by Eva
--------------------------
1230 stmts in analyzed functions, 104 stmts analyzed (8.5%)
1235 stmts in analyzed functions, 104 stmts analyzed (8.4%)
eva_main: 13 stmts out of 13 (100.0%)
main: 65 stmts out of 69 (94.2%)
tinfl_decompress_mem_to_callback: 15 stmts out of 28 (53.6%)
tinfl_decompress: 11 stmts out of 1120 (1.0%)
tinfl_decompress: 11 stmts out of 1125 (1.0%)
......@@ -2796,13 +2796,19 @@ tinfl_status __attribute__((__visibility__("default"))) tinfl_decompress
dist += extra_bits_0;
}
dist_from_out_buf_start = (unsigned long)(pOut_buf_cur - pOut_buf_start);
if ((size_t)dist > dist_from_out_buf_start)
if (decomp_flags & (unsigned int)TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF)
while (1) {
status = TINFL_STATUS_FAILED;
r->m_state = (unsigned int)37;
goto common_exit;
case (mz_uint32)37: ;
if (dist == (mz_uint32)0) goto _LOR_1;
else
if ((size_t)dist > dist_from_out_buf_start) goto _LOR_1;
else
if (dist_from_out_buf_start == (size_t)0) {
_LOR_1: ;
if (decomp_flags & (unsigned int)TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF)
while (1) {
status = TINFL_STATUS_FAILED;
r->m_state = (unsigned int)37;
goto common_exit;
case (mz_uint32)37: ;
}
}
pSrc = pOut_buf_start + ((dist_from_out_buf_start - (size_t)dist) & out_buf_size_mask);
if (pOut_buf_cur > pSrc) tmp_43 = pOut_buf_cur;
......
......@@ -39,15 +39,15 @@ Potential entry points (16)
Global metrics
==============
Sloc = 1817
Decision point = 341
Sloc = 1822
Decision point = 343
Global variables = 8
If = 309
If = 311
Loop = 93
Goto = 99
Goto = 101
Assignment = 837
Exit point = 33
Function = 37
Function call = 85
Pointer dereferencing = 443
Cyclomatic complexity = 374
Cyclomatic complexity = 376
......@@ -7,7 +7,7 @@ Coverage estimation = 100.0%
------------------------------------
[metrics] Statements analyzed by Eva
--------------------------
3418 stmts in analyzed functions, 2153 stmts analyzed (63.0%)
3423 stmts in analyzed functions, 2153 stmts analyzed (62.9%)
TDEFL_READ_UNALIGNED_WORD: 2 stmts out of 2 (100.0%)
TDEFL_READ_UNALIGNED_WORD2: 2 stmts out of 2 (100.0%)
TDEFL_READ_UNALIGNED_WORD32: 2 stmts out of 2 (100.0%)
......@@ -31,4 +31,4 @@ tdefl_start_dynamic_block: 366 stmts out of 399 (91.7%)
main: 230 stmts out of 264 (87.1%)
tdefl_compress: 87 stmts out of 103 (84.5%)
tdefl_flush_block: 251 stmts out of 318 (78.9%)
tinfl_decompress: 11 stmts out of 1120 (1.0%)
tinfl_decompress: 11 stmts out of 1125 (1.0%)
......@@ -7778,13 +7778,19 @@ tinfl_status __attribute__((__visibility__("default"))) tinfl_decompress
dist += extra_bits_0;
}
dist_from_out_buf_start = (unsigned long)(pOut_buf_cur - pOut_buf_start);
if ((size_t)dist > dist_from_out_buf_start)
if (decomp_flags & (unsigned int)TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF)
while (1) {
status = TINFL_STATUS_FAILED;
r->m_state = (unsigned int)37;
goto common_exit;
case (mz_uint32)37: ;
if (dist == (mz_uint32)0) goto _LOR_1;
else
if ((size_t)dist > dist_from_out_buf_start) goto _LOR_1;
else
if (dist_from_out_buf_start == (size_t)0) {
_LOR_1: ;
if (decomp_flags & (unsigned int)TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF)
while (1) {
status = TINFL_STATUS_FAILED;
r->m_state = (unsigned int)37;
goto common_exit;
case (mz_uint32)37: ;
}
}
pSrc = pOut_buf_start + ((dist_from_out_buf_start - (size_t)dist) & out_buf_size_mask);
if (pOut_buf_cur > pSrc) tmp_43 = pOut_buf_cur;
......
......@@ -58,15 +58,15 @@ Potential entry points (21)
Global metrics
==============
Sloc = 4209
Decision point = 726
Sloc = 4214
Decision point = 728
Global variables = 23
If = 693
If = 695
Loop = 180
Goto = 178
Goto = 180
Assignment = 2038
Exit point = 64
Function = 64
Function call = 251
Pointer dereferencing = 1479
Cyclomatic complexity = 790
Cyclomatic complexity = 792
[kernel] warning: 51 states in saved file ignored. They are invalid in this Frama-C configuration.
[kernel] warning: 512 states in memory reset to their default value. They are inconsistent in this Frama_C configuration.
[kernel] warning: attempting to save on non-zero exit code: modifying filename into `/home/andr/git/oscs/miniz/.frama-c/miniz.eva/framac.sav.error'.
......@@ -7,7 +7,11 @@ else()
project(miniz C)
endif()
include(GNUInstallDirs)
# determine whether this is a standalone project or included by other projects
set(MINIZ_STANDALONE_PROJECT OFF)
if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
set(MINIZ_STANDALONE_PROJECT ON)
endif ()
set(MINIZ_API_VERSION 2)
set(MINIZ_MINOR_VERSION 1)
......@@ -23,14 +27,19 @@ if(CMAKE_BUILD_TYPE STREQUAL "")
CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel." FORCE)
endif ()
option(BUILD_EXAMPLES "Build examples" ON)
option(BUILD_EXAMPLES "Build examples" ${MINIZ_STANDALONE_PROJECT})
option(BUILD_FUZZERS "Build fuzz targets" OFF)
option(AMALGAMATE_SOURCES "Amalgamate sources into miniz.h/c" OFF)
option(BUILD_HEADER_ONLY "Build a header-only version" OFF)
option(BUILD_SHARED_LIBS "Build shared library instead of static" ON)
option(INSTALL_PROJECT "Install project" ${MINIZ_STANDALONE_PROJECT})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/bin)
if(INSTALL_PROJECT)
include(GNUInstallDirs)
endif()
if(BUILD_HEADER_ONLY)
set(AMALGAMATE_SOURCES ON CACHE BOOL "Build a header-only version" FORCE)
endif(BUILD_HEADER_ONLY)
......@@ -124,11 +133,13 @@ if(NOT BUILD_HEADER_ONLY)
PRIVATE $<$<C_COMPILER_ID:GNU>:_GNU_SOURCE>)
# pkg-config file
configure_file(miniz.pc.in ${CMAKE_BINARY_DIR}/miniz.pc @ONLY)
configure_file(miniz.pc.in ${CMAKE_CURRENT_BINARY_DIR}/miniz.pc @ONLY)
if(INSTALL_PROJECT)
install(FILES
${CMAKE_BINARY_DIR}/miniz.pc
${CMAKE_CURRENT_BINARY_DIR}/miniz.pc
DESTINATION ${CMAKE_INSTALL_DATADIR}/pkgconfig)
endif()
endif()
set_property(TARGET ${PROJECT_NAME} PROPERTY
......@@ -137,6 +148,7 @@ set_property(TARGET ${PROJECT_NAME} APPEND PROPERTY
COMPATIBLE_INTERFACE_STRING ${PROJECT_NAME}_MAJOR_VERSION
)
if(INSTALL_PROJECT)
install(TARGETS ${PROJECT_NAME} EXPORT ${PROJECT_NAME}Targets
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
......@@ -179,6 +191,7 @@ install(
COMPONENT
Devel
)
endif()
if(BUILD_EXAMPLES)
set(EXAMPLE1_SRC_LIST "${CMAKE_CURRENT_SOURCE_DIR}/examples/example1.c")
......@@ -217,6 +230,11 @@ if(BUILD_FUZZERS)
set(CHECKSUM_FUZZER_SRC_LIST "${FUZZ_MAIN_SRC}" "${CMAKE_CURRENT_SOURCE_DIR}/tests/checksum_fuzzer.c")
set(FLUSH_FUZZER_SRC_LIST "${FUZZ_MAIN_SRC}" "${CMAKE_CURRENT_SOURCE_DIR}/tests/flush_fuzzer.c")
set(UNCOMPRESS_FUZZER_SRC_LIST "${FUZZ_MAIN_SRC}" "${CMAKE_CURRENT_SOURCE_DIR}/tests/uncompress_fuzzer.c")
set(UNCOMPRESS2_FUZZER_SRC_LIST "${FUZZ_MAIN_SRC}" "${CMAKE_CURRENT_SOURCE_DIR}/tests/uncompress2_fuzzer.c")
set(COMPRESS_FUZZER_SRC_LIST "${FUZZ_MAIN_SRC}" "${CMAKE_CURRENT_SOURCE_DIR}/tests/compress_fuzzer.c")
set(SMALL_FUZZER_SRC_LIST "${FUZZ_MAIN_SRC}" "${CMAKE_CURRENT_SOURCE_DIR}/tests/small_fuzzer.c")
set(LARGE_FUZZER_SRC_LIST "${FUZZ_MAIN_SRC}" "${CMAKE_CURRENT_SOURCE_DIR}/tests/large_fuzzer.c")
set(ZIP_FUZZER_SRC_LIST "${FUZZ_MAIN_SRC}" "${CMAKE_CURRENT_SOURCE_DIR}/tests/zip_fuzzer.c")
add_executable(checksum_fuzzer ${CHECKSUM_FUZZER_SRC_LIST})
target_link_libraries(checksum_fuzzer miniz)
......@@ -226,10 +244,26 @@ if(BUILD_FUZZERS)
add_executable(uncompress_fuzzer ${UNCOMPRESS_FUZZER_SRC_LIST})
target_link_libraries(uncompress_fuzzer miniz)
add_executable(uncompress2_fuzzer ${UNCOMPRESS2_FUZZER_SRC_LIST})
target_link_libraries(uncompress2_fuzzer miniz)
add_executable(compress_fuzzer ${COMPRESS_FUZZER_SRC_LIST})
target_link_libraries(compress_fuzzer miniz)
add_executable(small_fuzzer ${SMALL_FUZZER_SRC_LIST})
target_link_libraries(small_fuzzer miniz)
add_executable(large_fuzzer ${LARGE_FUZZER_SRC_LIST})
target_link_libraries(large_fuzzer miniz)
add_executable(zip_fuzzer ${ZIP_FUZZER_SRC_LIST})
target_link_libraries(zip_fuzzer miniz)
endif()
set(INCLUDE_INSTALL_DIR "include")
if(INSTALL_PROJECT)
install(FILES ${INSTALL_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME})
endif()
include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake")
\ No newline at end of file
......@@ -12,4 +12,10 @@ libminiz = static_library('miniz',
include_directories: miniz_includes)
miniz_dependency = declare_dependency(link_with: libminiz,
include_directories: miniz_includes)
\ No newline at end of file
include_directories: miniz_includes)
miniz_dep = miniz_dependency # Compatibility for WrapDB users
if meson.version().version_compare('>= 0.54.0')
meson.override_dependency('miniz', miniz_dep)
endif
......@@ -95,7 +95,7 @@
possibility that the archive's central directory could be lost with this method if anything goes wrong, though.
- ZIP archive support limitations:
No zip64 or spanning support. Extraction functions can only handle unencrypted, stored or deflated files.
No spanning support. Extraction functions can only handle unencrypted, stored or deflated files.
Requires streams capable of seeking.
* This is a header file library, like stb_image.c. To get only a header file, either cut and paste the
......@@ -220,7 +220,7 @@ enum
#define MZ_DEFLATED 8
/* Heap allocation callbacks.
Note that mz_alloc_func parameter types purpsosely differ from zlib's: items/size is size_t, not unsigned long. */
Note that mz_alloc_func parameter types purposely differ from zlib's: items/size is size_t, not unsigned long. */
typedef void *(*mz_alloc_func)(void *opaque, size_t items, size_t size);
typedef void (*mz_free_func)(void *opaque, void *address);
typedef void *(*mz_realloc_func)(void *opaque, void *address, size_t items, size_t size);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment