File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -493,7 +493,15 @@ jl_code_instance_t *jl_generate_fptr_impl(jl_method_instance_t *mi JL_PROPAGATES
493493 }
494494 else {
495495 // identify whether this is an invalidated method that is being recompiled
496- is_recompile = jl_atomic_load_relaxed (&mi->cache ) != NULL ;
496+ // Is a recompile if there is cached code, and it was compiled (not only inferred) before
497+ jl_code_instance_t *codeinst_old = jl_atomic_load_relaxed (&mi->cache );
498+ while (codeinst_old != NULL ) {
499+ if (jl_atomic_load_relaxed (&codeinst_old->invoke ) != NULL ) {
500+ is_recompile = 1 ;
501+ break ;
502+ }
503+ codeinst_old = jl_atomic_load_relaxed (&codeinst_old->next );
504+ }
497505 }
498506 if (src == NULL && jl_is_method (mi->def .method ) &&
499507 jl_symbol_name (mi->def .method ->name )[0 ] != ' @' ) {
You can’t perform that action at this time.
0 commit comments