Skip to content

Commit 20f6344

Browse files
committed
avoid invalidations when it doesn't resolve an MethodError
In these cases, the new method would not be called because the call would still be an ambiguity error instead. We also might observe that the method doesn't resolve an old MethodError because it was previously covered by a different method.
1 parent 9267bbf commit 20f6344

File tree

3 files changed

+155
-140
lines changed

3 files changed

+155
-140
lines changed

src/gc.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2641,6 +2641,7 @@ mark: {
26412641

26422642
extern jl_typemap_entry_t *call_cache[N_CALL_CACHE];
26432643
extern jl_array_t *jl_all_methods;
2644+
extern jl_array_t *_jl_debug_method_invalidation;
26442645

26452646
static void jl_gc_queue_thread_local(jl_gc_mark_cache_t *gc_cache, jl_gc_mark_sp_t *sp,
26462647
jl_ptls_t ptls2)
@@ -2680,6 +2681,8 @@ static void mark_roots(jl_gc_mark_cache_t *gc_cache, jl_gc_mark_sp_t *sp)
26802681
gc_mark_queue_obj(gc_cache, sp, call_cache[i]);
26812682
if (jl_all_methods != NULL)
26822683
gc_mark_queue_obj(gc_cache, sp, jl_all_methods);
2684+
if (_jl_debug_method_invalidation != NULL)
2685+
gc_mark_queue_obj(gc_cache, sp, _jl_debug_method_invalidation);
26832686

26842687
// constants
26852688
gc_mark_queue_obj(gc_cache, sp, jl_emptytuple_type);

0 commit comments

Comments
 (0)