@@ -5233,6 +5233,13 @@ buffer_add_value_full (Buffer *buf, MonoType *t, void *addr, MonoDomain *domain,
5233
5233
nfields = 0 ;
5234
5234
iter = NULL ;
5235
5235
while ((f = mono_class_get_fields_internal (klass , & iter ))) {
5236
+ if (G_UNLIKELY (!f -> type )) {
5237
+ ERROR_DECL (error );
5238
+ mono_field_resolve_type (f , error );
5239
+ mono_error_cleanup (error );
5240
+ if (!f -> type )
5241
+ continue ;
5242
+ }
5236
5243
if (f -> type -> attrs & FIELD_ATTRIBUTE_STATIC )
5237
5244
continue ;
5238
5245
if (mono_field_is_deleted (f ))
@@ -5250,6 +5257,13 @@ buffer_add_value_full (Buffer *buf, MonoType *t, void *addr, MonoDomain *domain,
5250
5257
5251
5258
iter = NULL ;
5252
5259
while ((f = mono_class_get_fields_internal (klass , & iter ))) {
5260
+ if (G_UNLIKELY (!f -> type )) {
5261
+ ERROR_DECL (error );
5262
+ mono_field_resolve_type (f , error );
5263
+ mono_error_cleanup (error );
5264
+ if (!f -> type )
5265
+ continue ;
5266
+ }
5253
5267
if (f -> type -> attrs & FIELD_ATTRIBUTE_STATIC )
5254
5268
continue ;
5255
5269
if (mono_field_is_deleted (f ))
@@ -5351,6 +5365,13 @@ decode_vtype (MonoType *t, MonoDomain *domain, gpointer void_addr, gpointer void
5351
5365
5352
5366
nfields = decode_int (buf , & buf , limit );
5353
5367
while ((f = mono_class_get_fields_internal (klass , & iter ))) {
5368
+ if (G_UNLIKELY (!f -> type )) {
5369
+ ERROR_DECL (error );
5370
+ mono_field_resolve_type (f , error );
5371
+ mono_error_cleanup (error );
5372
+ if (!f -> type )
5373
+ continue ;
5374
+ }
5354
5375
if (f -> type -> attrs & FIELD_ATTRIBUTE_STATIC )
5355
5376
continue ;
5356
5377
if (mono_field_is_deleted (f ))
@@ -5459,6 +5480,13 @@ decode_vtype_compute_size (MonoType *t, MonoDomain *domain, gpointer void_buf, g
5459
5480
5460
5481
nfields = decode_int (buf , & buf , limit );
5461
5482
while ((f = mono_class_get_fields_internal (klass , & iter ))) {
5483
+ if (G_UNLIKELY (!f -> type )) {
5484
+ ERROR_DECL (error );
5485
+ mono_field_resolve_type (f , error );
5486
+ mono_error_cleanup (error );
5487
+ if (!f -> type )
5488
+ continue ;
5489
+ }
5462
5490
if (f -> type -> attrs & FIELD_ATTRIBUTE_STATIC )
5463
5491
continue ;
5464
5492
if (mono_field_is_deleted (f ))
@@ -8476,6 +8504,13 @@ type_commands_internal (int command, MonoClass *klass, MonoDomain *domain, guint
8476
8504
buffer_add_int (buf , nfields );
8477
8505
8478
8506
while ((f = mono_class_get_fields_internal (klass , & iter ))) {
8507
+ if (G_UNLIKELY (!f -> type )) {
8508
+ ERROR_DECL (field_error );
8509
+ mono_field_resolve_type (f , field_error );
8510
+ mono_error_cleanup (field_error );
8511
+ if (!f -> type )
8512
+ continue ;
8513
+ }
8479
8514
buffer_add_fieldid (buf , domain , f );
8480
8515
buffer_add_string (buf , f -> name );
8481
8516
buffer_add_typeid (buf , domain , mono_class_from_mono_type_internal (f -> type ));
@@ -8856,6 +8891,13 @@ type_commands_internal (int command, MonoClass *klass, MonoDomain *domain, guint
8856
8891
int nfields = 0 ;
8857
8892
gpointer iter = NULL ;
8858
8893
while ((f = mono_class_get_fields_internal (klass , & iter ))) {
8894
+ if (G_UNLIKELY (!f -> type )) {
8895
+ ERROR_DECL (field_error );
8896
+ mono_field_resolve_type (f , field_error );
8897
+ mono_error_cleanup (field_error );
8898
+ if (!f -> type )
8899
+ continue ;
8900
+ }
8859
8901
if (f -> type -> attrs & FIELD_ATTRIBUTE_STATIC )
8860
8902
continue ;
8861
8903
if (mono_field_is_deleted (f ))
@@ -8866,6 +8908,13 @@ type_commands_internal (int command, MonoClass *klass, MonoDomain *domain, guint
8866
8908
8867
8909
iter = NULL ;
8868
8910
while ((f = mono_class_get_fields_internal (klass , & iter ))) {
8911
+ if (G_UNLIKELY (!f -> type )) {
8912
+ ERROR_DECL (field_error );
8913
+ mono_field_resolve_type (f , field_error );
8914
+ mono_error_cleanup (field_error );
8915
+ if (!f -> type )
8916
+ continue ;
8917
+ }
8869
8918
if (f -> type -> attrs & FIELD_ATTRIBUTE_STATIC )
8870
8919
continue ;
8871
8920
if (mono_field_is_deleted (f ))
0 commit comments