From 062bfa99c71a53a6cb35fc89a52d67bbff2bb2d0 Mon Sep 17 00:00:00 2001 From: walon Date: Thu, 25 May 2023 18:24:18 +0800 Subject: [PATCH] =?UTF-8?q?[fix]=20=E4=BF=AE=E5=A4=8D=E4=BD=BF=E7=94=A8Mom?= =?UTF-8?q?ery=20Profiler=E5=88=9B=E5=BB=BA=E5=BF=AB=E7=85=A7=E6=97=B6?= =?UTF-8?q?=E5=8F=91=E7=94=9F=E5=B4=A9=E6=BA=83=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hybridclr/metadata/InterpreterImage.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/hybridclr/metadata/InterpreterImage.cpp b/hybridclr/metadata/InterpreterImage.cpp index 0307a6b..819673b 100644 --- a/hybridclr/metadata/InterpreterImage.cpp +++ b/hybridclr/metadata/InterpreterImage.cpp @@ -1403,8 +1403,16 @@ namespace metadata auto& sizes = type.typeSizes; sizes.native_size = layout->nativeSize; - sizes.static_fields_size = layout->staticFieldsSize; - sizes.thread_static_fields_size = layout->threadStaticFieldsSize; + if (typeDef->genericContainerIndex == kGenericContainerIndexInvalid) + { + sizes.static_fields_size = layout->staticFieldsSize; + sizes.thread_static_fields_size = layout->threadStaticFieldsSize; + } + else + { + sizes.static_fields_size = 0; + sizes.thread_static_fields_size = 0; + } if (sizes.instance_size == 0) { sizes.instance_size = layout->instanceSize;