Skip to content

Commit 0ca21bd

Browse files
committed
UUM-79025 - Added case for MONO_TYPE_FNPTR to
mono_field_get_value_object_checked to set error instead of crash
1 parent 274abac commit 0ca21bd

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

mono/metadata/object.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3676,6 +3676,10 @@ mono_field_get_value_object_checked (MonoDomain *domain, MonoClassField *field,
36763676
case MONO_TYPE_PTR:
36773677
is_ptr = TRUE;
36783678
break;
3679+
case MONO_TYPE_FNPTR:
3680+
mono_error_set_error(error, MONO_ERROR_ARGUMENT, "Cannot get value of a function pointer field");
3681+
goto return_null;
3682+
36793683
default:
36803684
g_error ("type 0x%x not handled in "
36813685
"mono_field_get_value_object", type->type);

0 commit comments

Comments
 (0)