From 5f30b4af3f5f598efd47a148716969cf49722af3 Mon Sep 17 00:00:00 2001 From: Aaron Robinson Date: Fri, 4 Mar 2022 17:53:27 -0800 Subject: [PATCH 01/10] Remove 4996 --- src/coreclr/pal/src/safecrt/input.inl | 7 ------- src/coreclr/pal/src/safecrt/internal.h | 10 ---------- .../tools/superpmi/superpmi-shared/standardpch.h | 2 -- 3 files changed, 19 deletions(-) diff --git a/src/coreclr/pal/src/safecrt/input.inl b/src/coreclr/pal/src/safecrt/input.inl index 54b6296b5ca264..3f415d695833ae 100644 --- a/src/coreclr/pal/src/safecrt/input.inl +++ b/src/coreclr/pal/src/safecrt/input.inl @@ -40,9 +40,6 @@ #define UNALIGNED -#define _BEGIN_SECURE_CRT_DEPRECATION_DISABLE -#define _END_SECURE_CRT_DEPRECATION_DISABLE - #define _CVTBUFSIZE (309+40) /* # of digits in max. dp value + slop */ #define _MBTOWC(x,y,z) _minimal_chartowchar( x, y ) @@ -695,16 +692,12 @@ scanit: /* convert wide to multibyte */ if (array_width >= ((size_t)MB_CUR_MAX)) { -_BEGIN_SECURE_CRT_DEPRECATION_DISABLE temp = wctomb((char *)pointer, ch); -_END_SECURE_CRT_DEPRECATION_DISABLE } else { char tmpbuf[MB_LEN_MAX]; -_BEGIN_SECURE_CRT_DEPRECATION_DISABLE temp = wctomb(tmpbuf, ch); -_END_SECURE_CRT_DEPRECATION_DISABLE if (temp > 0 && ((size_t)temp) > array_width) { /* We have exhausted the user's buffer */ diff --git a/src/coreclr/pal/src/safecrt/internal.h b/src/coreclr/pal/src/safecrt/internal.h index 02f8f80091aa50..8497c9f6225720 100644 --- a/src/coreclr/pal/src/safecrt/internal.h +++ b/src/coreclr/pal/src/safecrt/internal.h @@ -1033,16 +1033,6 @@ _CRTIMP void * __cdecl _decode_pointer(void *); /* internal helper function for communicating with the debugger */ BOOL DebuggerKnownHandle(); -/* Macros to simplify the use of Secure CRT in the CRT itself. - * We should use [_BEGIN/_END]_SECURE_CRT_DEPRECATION_DISABLE sparingly. - */ -#define _BEGIN_SECURE_CRT_DEPRECATION_DISABLE \ - __pragma(warning(push)) \ - __pragma(warning(disable:4996)) - -#define _END_SECURE_CRT_DEPRECATION_DISABLE \ - __pragma(warning(pop)) - #define _ERRCHECK(e) \ _INVOKE_WATSON_IF_ERROR(e) diff --git a/src/coreclr/tools/superpmi/superpmi-shared/standardpch.h b/src/coreclr/tools/superpmi/superpmi-shared/standardpch.h index 1dfae365bc4dbc..33bdca950865af 100644 --- a/src/coreclr/tools/superpmi/superpmi-shared/standardpch.h +++ b/src/coreclr/tools/superpmi/superpmi-shared/standardpch.h @@ -24,8 +24,6 @@ #endif // INTERNAL_BUILD #ifdef _MSC_VER -#pragma warning(disable : 4996) // The compiler encountered a deprecated declaration. - // On Windows, we build against PAL macros that convert to Windows SEH. But we don't want all the // Contract stuff that normally gets pulled it. Defining JIT_BUILD prevents this, just as it does // when building the JIT using parts of utilcode. From e4166257c9e6884476b0869929b541f3e58e9a17 Mon Sep 17 00:00:00 2001 From: Aaron Robinson Date: Fri, 4 Mar 2022 18:02:41 -0800 Subject: [PATCH 02/10] Remove 4701 --- src/coreclr/jit/eeinterface.cpp | 5 ----- src/coreclr/jit/optimizer.cpp | 5 ++--- src/coreclr/vm/common.h | 3 --- 3 files changed, 2 insertions(+), 11 deletions(-) diff --git a/src/coreclr/jit/eeinterface.cpp b/src/coreclr/jit/eeinterface.cpp index 9976b3d6763cab..60c685e142b35a 100644 --- a/src/coreclr/jit/eeinterface.cpp +++ b/src/coreclr/jit/eeinterface.cpp @@ -21,9 +21,6 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX #if defined(DEBUG) || defined(FEATURE_JIT_METHOD_PERF) || defined(FEATURE_SIMD) -#pragma warning(push) -#pragma warning(disable : 4701) // difficult to get rid of C4701 with 'sig' below - /*****************************************************************************/ /***************************************************************************** @@ -246,8 +243,6 @@ const char* Compiler::eeGetMethodFullName(CORINFO_METHOD_HANDLE hnd) return (retName); } -#pragma warning(pop) - #endif // defined(DEBUG) || defined(FEATURE_JIT_METHOD_PERF) || defined(FEATURE_SIMD) /*****************************************************************************/ diff --git a/src/coreclr/jit/optimizer.cpp b/src/coreclr/jit/optimizer.cpp index 9bcefc7daf8c3b..a68b9944e6225e 100644 --- a/src/coreclr/jit/optimizer.cpp +++ b/src/coreclr/jit/optimizer.cpp @@ -13,7 +13,6 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX #include "jitpch.h" #ifdef _MSC_VER #pragma hdrstop -#pragma warning(disable : 4701) #endif /*****************************************************************************/ @@ -7365,8 +7364,8 @@ void Compiler::fgCreateLoopPreHeader(unsigned lnum) if (allValidProfileWeights) { - weight_t loopEnteredCount; - weight_t loopSkippedCount; + weight_t loopEnteredCount = 0; + weight_t loopSkippedCount = 0; bool useEdgeWeights = fgHaveValidEdgeWeights; if (useEdgeWeights) diff --git a/src/coreclr/vm/common.h b/src/coreclr/vm/common.h index eb37c0a0cac94b..bd01142f5b33cf 100644 --- a/src/coreclr/vm/common.h +++ b/src/coreclr/vm/common.h @@ -56,9 +56,6 @@ #pragma warning(disable:4710) // function not inlined #pragma warning(disable:4527) // user-defined destructor required #pragma warning(disable:4513) // destructor could not be generated - - // TODO we really probably need this one put back in!!! -//#pragma warning(disable:4701) // local variable may be used without being initialized #endif // _MSC_VER #define _CRT_DEPENDENCY_ //this code depends on the crt file functions From 4ae44a3af3b93eefb6f7292d188c6d6f13f5e53b Mon Sep 17 00:00:00 2001 From: Aaron Robinson Date: Fri, 4 Mar 2022 18:08:00 -0800 Subject: [PATCH 03/10] Remove 4611 --- src/coreclr/pal/inc/pal.h | 4 ---- src/coreclr/vm/fcall.h | 7 ------- 2 files changed, 11 deletions(-) diff --git a/src/coreclr/pal/inc/pal.h b/src/coreclr/pal/inc/pal.h index 9d9a437a79bdb3..b74c5b9dde7176 100644 --- a/src/coreclr/pal/inc/pal.h +++ b/src/coreclr/pal/inc/pal.h @@ -5037,10 +5037,6 @@ class NativeExceptionHolderFactory #define PAL_CPP_ENDTRY } -#ifdef _MSC_VER -#pragma warning(disable:4611) // interaction between '_setjmp' and C++ object destruction is non-portable -#endif - #define PAL_TRY_FOR_DLLMAIN(ParamType, paramDef, paramRef, _reason) PAL_TRY(ParamType, paramDef, paramRef) #endif // __cplusplus diff --git a/src/coreclr/vm/fcall.h b/src/coreclr/vm/fcall.h index e0816058bb3b8e..8bed3fbe26db29 100644 --- a/src/coreclr/vm/fcall.h +++ b/src/coreclr/vm/fcall.h @@ -240,13 +240,6 @@ // #include -// -// Use of setjmp is temporary, we will eventually have compiler intrinsics to -// disable the optimizations. Besides, we don't actually execute setjmp in -// these macros (or anywhere else in the VM on AMD64). -// -#pragma warning(disable:4611) // interaction between '_setjmp' and C++ object destruction is non-portable - #ifdef _DEBUG // // Linked list of unmanaged methods preceeding a HelperMethodFrame push. This From 819741e433ee5eced9eb184dabea8d0be2aa7ab9 Mon Sep 17 00:00:00 2001 From: Aaron Robinson Date: Fri, 4 Mar 2022 18:15:12 -0800 Subject: [PATCH 04/10] Remove 4610 --- src/coreclr/vm/common.h | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/coreclr/vm/common.h b/src/coreclr/vm/common.h index bd01142f5b33cf..fb9bf8097f1262 100644 --- a/src/coreclr/vm/common.h +++ b/src/coreclr/vm/common.h @@ -27,9 +27,7 @@ // These don't seem useful, so turning them off is no big deal #pragma warning(disable:4201) // nameless struct/union #pragma warning(disable:4510) // can't generate default constructor -//#pragma warning(disable:4511) // can't generate copy constructor #pragma warning(disable:4512) // can't generate assignment constructor -#pragma warning(disable:4610) // user defined constructor required #pragma warning(disable:4211) // nonstandard extention used (char name[0] in structs) #pragma warning(disable:4268) // 'const' static/global data initialized with compiler generated default constructor fills the object with zeros #pragma warning(disable:4238) // nonstandard extension used : class rvalue used as lvalue @@ -38,8 +36,6 @@ // Depending on the code base, you may want to not disable these #pragma warning(disable:4245) // assigning signed / unsigned -//#pragma warning(disable:4146) // unary minus applied to unsigned -//#pragma warning(disable:4244) // loss of data int -> char .. #pragma warning(disable:4127) // conditional expression is constant #pragma warning(disable:4100) // unreferenced formal parameter @@ -47,7 +43,6 @@ #ifndef DEBUG #pragma warning(disable:4505) // unreferenced local function has been removed -//#pragma warning(disable:4702) // unreachable code #pragma warning(disable:4313) // 'format specifier' in format string conflicts with argument %d of type 'type' #endif // !DEBUG From 65a0729b2571214724b4a7d135d1c1ed416f3828 Mon Sep 17 00:00:00 2001 From: Aaron Robinson Date: Fri, 4 Mar 2022 18:24:21 -0800 Subject: [PATCH 05/10] Remove 4510 --- src/coreclr/vm/common.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/coreclr/vm/common.h b/src/coreclr/vm/common.h index fb9bf8097f1262..07edf43e248100 100644 --- a/src/coreclr/vm/common.h +++ b/src/coreclr/vm/common.h @@ -26,7 +26,6 @@ // These don't seem useful, so turning them off is no big deal #pragma warning(disable:4201) // nameless struct/union -#pragma warning(disable:4510) // can't generate default constructor #pragma warning(disable:4512) // can't generate assignment constructor #pragma warning(disable:4211) // nonstandard extention used (char name[0] in structs) #pragma warning(disable:4268) // 'const' static/global data initialized with compiler generated default constructor fills the object with zeros From 0f32e0a796257c615ccb5b18c281613d047428a6 Mon Sep 17 00:00:00 2001 From: Aaron Robinson Date: Fri, 4 Mar 2022 19:16:52 -0800 Subject: [PATCH 06/10] Remove 4267 --- src/coreclr/debug/daccess/daccess.cpp | 9 +-------- src/coreclr/vm/codeman.cpp | 18 ++++-------------- src/coreclr/vm/eehash.cpp | 14 +++----------- src/coreclr/vm/object.cpp | 9 --------- src/coreclr/vm/reflectioninvocation.cpp | 18 +++--------------- src/coreclr/vm/virtualcallstub.h | 7 ------- 6 files changed, 11 insertions(+), 64 deletions(-) diff --git a/src/coreclr/debug/daccess/daccess.cpp b/src/coreclr/debug/daccess/daccess.cpp index 7936b3a1279a8c..7e7e5fe7c1d481 100644 --- a/src/coreclr/debug/daccess/daccess.cpp +++ b/src/coreclr/debug/daccess/daccess.cpp @@ -209,15 +209,8 @@ GetFullMethodNameFromMetadata(IMDInternalImport* mdImport, LPCUTF8 methodName; IfFailRet(mdImport->GetNameOfMethodDef(methodToken, &methodName)); -// Review conversion of size_t to ULONG32. -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable:4267) -#endif + len = strlen(methodName); -#ifdef _MSC_VER -#pragma warning(pop) -#endif if (len >= bufferChars) { return E_OUTOFMEMORY; diff --git a/src/coreclr/vm/codeman.cpp b/src/coreclr/vm/codeman.cpp index d039d00a7c2c97..ef4c0b8b6089ac 100644 --- a/src/coreclr/vm/codeman.cpp +++ b/src/coreclr/vm/codeman.cpp @@ -5468,21 +5468,11 @@ static void EnumRuntimeFunctionEntriesToFindEntry(PTR_RUNTIME_FUNCTION pRtf, PTR return; } - // Review conversion of size_t to ULONG. -#if defined(_MSC_VER) -#pragma warning(push) -#pragma warning(disable:4267) -#endif // defined(_MSC_VER) + UINT_PTR indexToLocate = pRtf - firstFunctionEntry; - ULONG indexToLocate = pRtf - firstFunctionEntry; - -#if defined(_MSC_VER) -#pragma warning(pop) -#endif // defined(_MSC_VER) - - ULONG low = 0; // index in the function entry table of low end of search range - ULONG high = (pProgramExceptionsDirectory->Size) / sizeof(T_RUNTIME_FUNCTION) - 1; // index of high end of search range - ULONG mid = (low + high) / 2; // index of entry to be compared + UINT_PTR low = 0; // index in the function entry table of low end of search range + UINT_PTR high = (pProgramExceptionsDirectory->Size) / sizeof(T_RUNTIME_FUNCTION) - 1; // index of high end of search range + UINT_PTR mid = (low + high) / 2; // index of entry to be compared if (indexToLocate > high) { diff --git a/src/coreclr/vm/eehash.cpp b/src/coreclr/vm/eehash.cpp index 39054c7fe67665..280c2731135bc9 100644 --- a/src/coreclr/vm/eehash.cpp +++ b/src/coreclr/vm/eehash.cpp @@ -32,17 +32,9 @@ EEHashEntry_t * EEUtf8HashTableHelper::AllocateEntry(LPCUTF8 pKey, BOOL bDeepCop if (bDeepCopy) { - DWORD StringLen = (DWORD)strlen(pKey); - DWORD BufLen = 0; -// Review conversion of size_t to DWORD. -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable:4267) -#endif - if (!ClrSafeInt::addition(StringLen, SIZEOF_EEHASH_ENTRY + sizeof(LPUTF8) + 1, BufLen)) -#ifdef _MSC_VER -#pragma warning(pop) -#endif + SIZE_T StringLen = strlen(pKey); + SIZE_T BufLen = 0; + if (!ClrSafeInt::addition(StringLen, SIZEOF_EEHASH_ENTRY + sizeof(LPUTF8) + 1, BufLen)) return NULL; pEntry = (EEHashEntry_t *) new (nothrow) BYTE[BufLen]; if (!pEntry) diff --git a/src/coreclr/vm/object.cpp b/src/coreclr/vm/object.cpp index 9cb54ede586a80..dabc5171b2ae98 100644 --- a/src/coreclr/vm/object.cpp +++ b/src/coreclr/vm/object.cpp @@ -1488,10 +1488,6 @@ void StackTraceArray::EnsureThreadAffinity() } } -#ifdef _MSC_VER -#pragma warning(disable: 4267) -#endif - // Deep copies the stack trace array void StackTraceArray::CopyFrom(StackTraceArray const & src) { @@ -1516,11 +1512,6 @@ void StackTraceArray::CopyFrom(StackTraceArray const & src) SetObjectThread(); // affinitize the newly created array with the current thread } -#ifdef _MSC_VER -#pragma warning(default: 4267) -#endif - - #ifdef _DEBUG //=============================================================================== // Code that insures that our unmanaged version of Nullable is consistant with diff --git a/src/coreclr/vm/reflectioninvocation.cpp b/src/coreclr/vm/reflectioninvocation.cpp index e49ad881f5fe54..2b403a3276737a 100644 --- a/src/coreclr/vm/reflectioninvocation.cpp +++ b/src/coreclr/vm/reflectioninvocation.cpp @@ -1483,14 +1483,8 @@ FCIMPL5(void, RuntimeFieldHandle::SetValueDirect, ReflectFieldObject *pFieldUNSA if (gc.oValue != 0) { value = 0; if (CoreLibBinder::IsClass(gc.oValue->GetMethodTable(), CLASS__POINTER)) { - value = (size_t) InvokeUtil::GetPointerValue(gc.oValue); -#ifdef _MSC_VER -#pragma warning(disable: 4267) //work-around for compiler -#endif - VolatileStore((size_t*) pDst, (size_t) value); -#ifdef _MSC_VER -#pragma warning(default: 4267) -#endif + value = (SIZE_T) InvokeUtil::GetPointerValue(gc.oValue); + VolatileStore((SIZE_T*) pDst, (SIZE_T) value); break; } } @@ -1502,13 +1496,7 @@ FCIMPL5(void, RuntimeFieldHandle::SetValueDirect, ReflectFieldObject *pFieldUNSA CorElementType objType = gc.oValue->GetTypeHandle().GetInternalCorElementType(); InvokeUtil::CreatePrimitiveValue(objType, objType, gc.oValue, &value); } -#ifdef _MSC_VER -#pragma warning(disable: 4267) //work-around for compiler -#endif - VolatileStore((size_t*) pDst, (size_t) value); -#ifdef _MSC_VER -#pragma warning(default: 4267) -#endif + VolatileStore((SIZE_T*) pDst, (SIZE_T) value); } break; diff --git a/src/coreclr/vm/virtualcallstub.h b/src/coreclr/vm/virtualcallstub.h index ec1c99877e129c..6d20733f5d6a80 100644 --- a/src/coreclr/vm/virtualcallstub.h +++ b/src/coreclr/vm/virtualcallstub.h @@ -1679,19 +1679,12 @@ class BucketTable CONSISTENCY_CHECK(index <= bucketMask()+CALL_STUB_FIRST_INDEX); return VolatileLoad(&buckets[index]); } - -#ifdef _MSC_VER -#pragma warning(disable: 4267) //work-around for the compiler -#endif inline void Write(size_t index, size_t value) { LIMITED_METHOD_CONTRACT; CONSISTENCY_CHECK(index <= bucketMask()+CALL_STUB_FIRST_INDEX); VolatileStore(&buckets[index], value); } -#ifdef _MSC_VER -#pragma warning(default: 4267) -#endif // We store (#buckets-1) in bucket[CALL_STUB_MASK_INDEX ==0] // We have two unused cells at bucket[CALL_STUB_COUNT_INDEX ==1] From 6e1f87bf2822264ffaea49570c5f1684b8a7bef4 Mon Sep 17 00:00:00 2001 From: Aaron Robinson Date: Fri, 4 Mar 2022 19:38:38 -0800 Subject: [PATCH 07/10] Remove 4267 - libunwind --- src/coreclr/pal/src/libunwind/CMakeLists.txt | 1 - src/coreclr/pal/src/libunwind/src/dwarf/Gfind_proc_info-lsb.c | 4 ++-- src/coreclr/pal/src/libunwind/src/mi/mempool.c | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/coreclr/pal/src/libunwind/CMakeLists.txt b/src/coreclr/pal/src/libunwind/CMakeLists.txt index 2e19c381f61d4e..4fc0240437e2f7 100644 --- a/src/coreclr/pal/src/libunwind/CMakeLists.txt +++ b/src/coreclr/pal/src/libunwind/CMakeLists.txt @@ -159,7 +159,6 @@ if(CLR_CMAKE_HOST_WIN32) add_compile_options(-wd4068) # ignore unknown pragma warnings (gcc pragmas) add_compile_options(-wd4146) # minus operator applied to unsigned add_compile_options(-wd4244) # possible loss of data - add_compile_options(-wd4267) # possible loss of data add_compile_options(-wd4334) # 32-bit shift implicitly converted to 64 bits # Disable warning due to incorrect format specifier in debugging printf via the Debug macro diff --git a/src/coreclr/pal/src/libunwind/src/dwarf/Gfind_proc_info-lsb.c b/src/coreclr/pal/src/libunwind/src/dwarf/Gfind_proc_info-lsb.c index 7f170915f61f44..1bfba29c0d4e0f 100644 --- a/src/coreclr/pal/src/libunwind/src/dwarf/Gfind_proc_info-lsb.c +++ b/src/coreclr/pal/src/libunwind/src/dwarf/Gfind_proc_info-lsb.c @@ -866,9 +866,9 @@ remote_lookup (unw_addr_space_t as, unw_word_t table, size_t table_size, int32_t rel_ip, struct table_entry *e, int32_t *last_ip_offset, void *arg) { - unsigned long table_len = table_size / sizeof (struct table_entry); + size_t table_len = table_size / sizeof (struct table_entry); unw_accessors_t *a = unw_get_accessors_int (as); - unsigned long lo, hi, mid; + size_t lo, hi, mid; unw_word_t e_addr = 0; int32_t start = 0; int ret; diff --git a/src/coreclr/pal/src/libunwind/src/mi/mempool.c b/src/coreclr/pal/src/libunwind/src/mi/mempool.c index 7c5d27d0c2c309..cc017ffdeb8e49 100644 --- a/src/coreclr/pal/src/libunwind/src/mi/mempool.c +++ b/src/coreclr/pal/src/libunwind/src/mi/mempool.c @@ -127,7 +127,7 @@ mempool_init (struct mempool *pool, size_t obj_size, size_t reserve) } pool->obj_size = obj_size; - pool->reserve = reserve; + pool->reserve = (unsigned int)reserve; pool->chunk_size = UNW_ALIGN(2*reserve*obj_size, pg_size); expand (pool); From b26b662610063d5184678e9976138a7aadbdff5a Mon Sep 17 00:00:00 2001 From: Aaron Robinson Date: Sat, 5 Mar 2022 06:47:29 -0800 Subject: [PATCH 08/10] Fix format issue and apply PR feedback --- src/coreclr/jit/optimizer.cpp | 2 +- src/coreclr/pal/src/libunwind/include/mempool.h | 2 +- src/coreclr/pal/src/libunwind/src/mi/mempool.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/coreclr/jit/optimizer.cpp b/src/coreclr/jit/optimizer.cpp index a68b9944e6225e..d87dcaeba6b25b 100644 --- a/src/coreclr/jit/optimizer.cpp +++ b/src/coreclr/jit/optimizer.cpp @@ -7366,7 +7366,7 @@ void Compiler::fgCreateLoopPreHeader(unsigned lnum) { weight_t loopEnteredCount = 0; weight_t loopSkippedCount = 0; - bool useEdgeWeights = fgHaveValidEdgeWeights; + bool useEdgeWeights = fgHaveValidEdgeWeights; if (useEdgeWeights) { diff --git a/src/coreclr/pal/src/libunwind/include/mempool.h b/src/coreclr/pal/src/libunwind/include/mempool.h index 1f1c77009933f2..ab27b06e0f3cb3 100644 --- a/src/coreclr/pal/src/libunwind/include/mempool.h +++ b/src/coreclr/pal/src/libunwind/include/mempool.h @@ -63,7 +63,7 @@ struct mempool pthread_mutex_t lock; size_t obj_size; /* object size (rounded up for alignment) */ size_t chunk_size; /* allocation granularity */ - unsigned int reserve; /* minimum (desired) size of the free-list */ + size_t reserve; /* minimum (desired) size of the free-list */ unsigned int num_free; /* number of objects on the free-list */ struct object { diff --git a/src/coreclr/pal/src/libunwind/src/mi/mempool.c b/src/coreclr/pal/src/libunwind/src/mi/mempool.c index cc017ffdeb8e49..7c5d27d0c2c309 100644 --- a/src/coreclr/pal/src/libunwind/src/mi/mempool.c +++ b/src/coreclr/pal/src/libunwind/src/mi/mempool.c @@ -127,7 +127,7 @@ mempool_init (struct mempool *pool, size_t obj_size, size_t reserve) } pool->obj_size = obj_size; - pool->reserve = (unsigned int)reserve; + pool->reserve = reserve; pool->chunk_size = UNW_ALIGN(2*reserve*obj_size, pg_size); expand (pool); From 40684e9b81bfd7c5881a4c44e45cd3fac9009775 Mon Sep 17 00:00:00 2001 From: Aaron Robinson Date: Sat, 5 Mar 2022 19:43:06 -0800 Subject: [PATCH 09/10] Add libunwind PR version to apply --- src/coreclr/pal/src/libunwind/libunwind-version.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/src/coreclr/pal/src/libunwind/libunwind-version.txt b/src/coreclr/pal/src/libunwind/libunwind-version.txt index fbc2538a02f2ed..c118043054b877 100644 --- a/src/coreclr/pal/src/libunwind/libunwind-version.txt +++ b/src/coreclr/pal/src/libunwind/libunwind-version.txt @@ -5,6 +5,7 @@ Replace CMakeLists.txt, src/CMakeLists.txt, configure.cmake with .NET custom ver Keep .NET oop directory Reapply changes from https://github.com/dotnet/runtime/commit/1b5719c2e3dde393531eaeb5b5cde05dabeef5b8 Apply https://github.com/libunwind/libunwind/pull/317 +Apply https://github.com/libunwind/libunwind/pull/333 For LoongArch64: Apply https://github.com/libunwind/libunwind/pull/316 and https://github.com/libunwind/libunwind/pull/322 From a7f56a77887edaaf80342b49f3e5411c2c7f74aa Mon Sep 17 00:00:00 2001 From: Aaron Robinson Date: Tue, 8 Mar 2022 12:09:52 -0800 Subject: [PATCH 10/10] Review feedback. --- src/coreclr/pal/src/libunwind/include/mempool.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/coreclr/pal/src/libunwind/include/mempool.h b/src/coreclr/pal/src/libunwind/include/mempool.h index ab27b06e0f3cb3..60b9137280922a 100644 --- a/src/coreclr/pal/src/libunwind/include/mempool.h +++ b/src/coreclr/pal/src/libunwind/include/mempool.h @@ -64,7 +64,7 @@ struct mempool size_t obj_size; /* object size (rounded up for alignment) */ size_t chunk_size; /* allocation granularity */ size_t reserve; /* minimum (desired) size of the free-list */ - unsigned int num_free; /* number of objects on the free-list */ + size_t num_free; /* number of objects on the free-list */ struct object { struct object *next;