Skip to content

Commit c1240aa

Browse files
realekUnityAlex
authored andcommitted
*mirriored walking of all class fields from Mono 4.0 pr (#1065)
*added missing include which caused the function signature to be int thus downcasting the pointer from 64 bit to 32
1 parent 6d2a899 commit c1240aa

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

unity/unity_memory_info.c

+3-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#include <libgc/include/gc.h>
1212
#include <libgc/include/private/gc_priv.h>
1313
#include <mono/metadata/gc-internal.h>
14-
14+
#include <mono/metadata/mono-debug-debugger.h>
1515
#include <glib.h>
1616

1717
typedef struct CollectMetadataContext
@@ -166,7 +166,8 @@ static void AddMetadataType(gpointer key, gpointer value, gpointer user_data)
166166
}
167167

168168
vtable = mono_class_try_get_vtable(mono_domain_get(), klass);
169-
statics_data = vtable ? vtable->data : NULL;
169+
statics_data = vtable ? mono_vtable_get_static_field_data(vtable) : NULL;
170+
170171
type->staticsSize = statics_data ? mono_class_data_size(klass) : 0;
171172
type->statics = NULL;
172173

0 commit comments

Comments
 (0)