Skip to content

Commit

Permalink
Merge pull request #1796 from Unity-Technologies/bugfix/uum-45293
Browse files Browse the repository at this point in the history
Adding null check for result of mini_get_method
  • Loading branch information
bholmes authored Aug 8, 2023
2 parents 040f3c7 + 37b7bf7 commit ffa25b9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mono/mini/method-to-ir.c
Original file line number Diff line number Diff line change
Expand Up @@ -9242,7 +9242,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
guint32 gettype_token;
if ((ip = il_read_call(next_ip, end, &gettype_token)) && ip_in_bb (cfg, cfg->cbb, ip)) {
MonoMethod* gettype_method = mini_get_method (cfg, method, gettype_token, NULL, generic_context);
if (!strcmp (gettype_method->name, "GetType") && gettype_method->klass == mono_defaults.object_class) {
if (gettype_method && !strcmp (gettype_method->name, "GetType") && gettype_method->klass == mono_defaults.object_class) {
mono_class_init_internal(klass);
if (mono_class_get_checked (m_class_get_image (klass), m_class_get_type_token (klass), error) == klass) {
if (cfg->compile_aot) {
Expand Down

0 comments on commit ffa25b9

Please sign in to comment.