Skip to content

Commit

Permalink
UUM-79025 - Added case for MONO_TYPE_FNPTR to
Browse files Browse the repository at this point in the history
mono_field_get_value_object_checked to set error instead of crash
  • Loading branch information
PatrickSycz committed Oct 10, 2024
1 parent 274abac commit 0ca21bd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions mono/metadata/object.c
Original file line number Diff line number Diff line change
Expand Up @@ -3676,6 +3676,10 @@ mono_field_get_value_object_checked (MonoDomain *domain, MonoClassField *field,
case MONO_TYPE_PTR:
is_ptr = TRUE;
break;
case MONO_TYPE_FNPTR:
mono_error_set_error(error, MONO_ERROR_ARGUMENT, "Cannot get value of a function pointer field");
goto return_null;

default:
g_error ("type 0x%x not handled in "
"mono_field_get_value_object", type->type);
Expand Down

0 comments on commit 0ca21bd

Please sign in to comment.