Skip to content

Commit 055be26

Browse files
committed
Make ASAN happy
1 parent ae587fd commit 055be26

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed

src/dump.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2304,7 +2304,7 @@ void remove_code_instance_from_validation(jl_code_instance_t *codeinst)
23042304
ptrhash_remove(&new_code_instance_validate, codeinst);
23052305
}
23062306

2307-
static void jl_insert_method_instances(jl_array_t *list)
2307+
static void jl_insert_method_instances(jl_array_t *list) JL_GC_DISABLED
23082308
{
23092309
size_t i, l = jl_array_len(list);
23102310
// Validate the MethodInstances

src/gf.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1445,19 +1445,23 @@ static void invalidate_method_instance(void (*f)(jl_code_instance_t*), jl_method
14451445
codeinst->max_world = max_world;
14461446
}
14471447
assert(codeinst->max_world <= max_world);
1448+
JL_GC_PUSH1(&codeinst);
14481449
(*f)(codeinst);
1450+
JL_GC_POP();
14491451
codeinst = jl_atomic_load_relaxed(&codeinst->next);
14501452
}
14511453
// recurse to all backedges to update their valid range also
14521454
jl_array_t *backedges = replaced->backedges;
14531455
if (backedges) {
1456+
JL_GC_PUSH1(&backedges);
14541457
replaced->backedges = NULL;
14551458
size_t i = 0, l = jl_array_len(backedges);
14561459
jl_method_instance_t *replaced;
14571460
while (i < l) {
14581461
i = get_next_backedge(backedges, i, NULL, &replaced);
14591462
invalidate_method_instance(f, replaced, max_world, depth + 1);
14601463
}
1464+
JL_GC_POP();
14611465
}
14621466
JL_UNLOCK(&replaced->def.method->writelock);
14631467
}

src/julia_internal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,7 @@ JL_DLLEXPORT jl_code_info_t *jl_new_code_info_uninit(void);
551551
void jl_resolve_globals_in_ir(jl_array_t *stmts, jl_module_t *m, jl_svec_t *sparam_vals,
552552
int binding_effects);
553553

554-
int get_next_backedge(jl_array_t *list, int i, jl_value_t** invokesig, jl_method_instance_t **caller);
554+
int get_next_backedge(jl_array_t *list, int i, jl_value_t** invokesig, jl_method_instance_t **caller) JL_NOTSAFEPOINT;
555555
int set_next_backedge(jl_array_t *list, int i, jl_value_t *invokesig, jl_method_instance_t *caller);
556556
void push_backedge(jl_array_t *list, jl_value_t *invokesig, jl_method_instance_t *caller);
557557

src/method.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -790,7 +790,7 @@ JL_DLLEXPORT jl_method_t *jl_new_method_uninit(jl_module_t *module)
790790
// it will be the signature supplied in an `invoke` call.
791791
// If you don't need `invokesig`, you can set it to NULL on input.
792792
// Initialize iteration with `i = 0`. Returns `i` for the next backedge to be extracted.
793-
int get_next_backedge(jl_array_t *list, int i, jl_value_t** invokesig, jl_method_instance_t **caller)
793+
int get_next_backedge(jl_array_t *list, int i, jl_value_t** invokesig, jl_method_instance_t **caller) JL_NOTSAFEPOINT
794794
{
795795
jl_value_t *item = jl_array_ptr_ref(list, i);
796796
if (jl_is_method_instance(item)) {

0 commit comments

Comments
 (0)