Skip to content

Commit

Permalink
[fix] 修复使用Momery Profiler创建快照时发生崩溃的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
walon committed Jun 1, 2023
1 parent 3681285 commit 062bfa9
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions hybridclr/metadata/InterpreterImage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 062bfa9

Please sign in to comment.