Skip to content

Commit 87bd732

Browse files
committed
VS2022: Workaround an Internal compiler error for Release ARM (32-bit) build
1 parent 51cd74b commit 87bd732

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

lib/zip_io_util.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,13 @@ _zip_read_data(zip_buffer_t *buffer, zip_source_t *src, size_t length, bool nulp
6969
return NULL;
7070
}
7171

72+
// VS2022: Workaround an Internal compiler error for Release ARM (32-bit) build.
73+
#if _MSC_VER >= 1940 && _MSC_VER < 1950 && defined(_M_ARM) && defined(NDEBUG)
74+
size_t l = length + (nulp ? 1 : 0);
75+
r = (zip_uint8_t *)malloc(l);
76+
#else
7277
r = (zip_uint8_t *)malloc(length + (nulp ? 1 : 0));
78+
#endif
7379
if (!r) {
7480
zip_error_set(error, ZIP_ER_MEMORY, 0);
7581
return NULL;

0 commit comments

Comments
 (0)