From e0c6d703d709e589c4e31d964d320539151ba49b Mon Sep 17 00:00:00 2001 From: Elinor Fung Date: Thu, 5 Sep 2024 19:02:11 -0700 Subject: [PATCH] Fix incorrect handle type count when FEATURE_SIZED_REF_HANDLES is not defined (#107433) Regression from https://github.com/dotnet/runtime/pull/107326 - without `FEATURE_SIZED_REF_HANDLES` defined, this was incorrectly passing an array of two handle types - HNDTYPE_STRONG and HNDTYPE_WEAK_SHORT (0) - when promoting objects pointed to by strong handles. --- src/coreclr/gc/objecthandle.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/coreclr/gc/objecthandle.cpp b/src/coreclr/gc/objecthandle.cpp index 7f7f3ec1d54630..6f3bb7a52fa338 100644 --- a/src/coreclr/gc/objecthandle.cpp +++ b/src/coreclr/gc/objecthandle.cpp @@ -1105,7 +1105,7 @@ void Ref_TraceNormalRoots(uint32_t condemned, uint32_t maxgen, ScanContext* sc, // promote objects pointed to by strong handles // during ephemeral GCs we also want to promote the ones pointed to by sizedref handles. - uint32_t types[2] = { + uint32_t types[] = { HNDTYPE_STRONG, #ifdef FEATURE_SIZED_REF_HANDLES HNDTYPE_SIZEDREF