Skip to content

Commit

Permalink
Speculative assertions for issue 109410
Browse files Browse the repository at this point in the history
  • Loading branch information
kg committed Mar 4, 2025
1 parent 76209ca commit 60bf9ea
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/mono/mono/metadata/object.c
Original file line number Diff line number Diff line change
Expand Up @@ -6806,6 +6806,8 @@ mono_object_handle_isinst (MonoObjectHandle obj, MonoClass *klass, MonoError *er
{
error_init (error);

g_assert (klass);

if (!m_class_is_inited (klass))
mono_class_init_internal (klass);

Expand Down
4 changes: 4 additions & 0 deletions src/mono/mono/mini/type-checking.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,14 @@ emit_cached_check_args (MonoCompile *cfg, MonoInst *obj, MonoClass *klass, int c
/* klass - it's the second element of the cache entry*/
EMIT_NEW_LOAD_MEMBASE (cfg, args [1], OP_LOAD_MEMBASE, alloc_preg (cfg), cache_ins->dreg, TARGET_SIZEOF_VOID_P);

/* klass nullcheck */
MONO_EMIT_EXPLICIT_NULL_CHECK (cfg, args [1]->dreg);

args [2] = cache_ins; /* cache */
} else {
int idx;

g_assert (klass);
EMIT_NEW_CLASSCONST (cfg, args [1], klass); /* klass */

idx = get_castclass_cache_idx (cfg); /* inline cache*/
Expand Down

0 comments on commit 60bf9ea

Please sign in to comment.