Skip to content

Commit

Permalink
Make ASAN happy
Browse files Browse the repository at this point in the history
  • Loading branch information
timholy committed Jul 14, 2022
1 parent ae587fd commit 055be26
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/dump.c
Original file line number Diff line number Diff line change
Expand Up @@ -2304,7 +2304,7 @@ void remove_code_instance_from_validation(jl_code_instance_t *codeinst)
ptrhash_remove(&new_code_instance_validate, codeinst);
}

static void jl_insert_method_instances(jl_array_t *list)
static void jl_insert_method_instances(jl_array_t *list) JL_GC_DISABLED
{
size_t i, l = jl_array_len(list);
// Validate the MethodInstances
Expand Down
4 changes: 4 additions & 0 deletions src/gf.c
Original file line number Diff line number Diff line change
Expand Up @@ -1445,19 +1445,23 @@ static void invalidate_method_instance(void (*f)(jl_code_instance_t*), jl_method
codeinst->max_world = max_world;
}
assert(codeinst->max_world <= max_world);
JL_GC_PUSH1(&codeinst);
(*f)(codeinst);
JL_GC_POP();
codeinst = jl_atomic_load_relaxed(&codeinst->next);
}
// recurse to all backedges to update their valid range also
jl_array_t *backedges = replaced->backedges;
if (backedges) {
JL_GC_PUSH1(&backedges);
replaced->backedges = NULL;
size_t i = 0, l = jl_array_len(backedges);
jl_method_instance_t *replaced;
while (i < l) {
i = get_next_backedge(backedges, i, NULL, &replaced);
invalidate_method_instance(f, replaced, max_world, depth + 1);
}
JL_GC_POP();
}
JL_UNLOCK(&replaced->def.method->writelock);
}
Expand Down
2 changes: 1 addition & 1 deletion src/julia_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ JL_DLLEXPORT jl_code_info_t *jl_new_code_info_uninit(void);
void jl_resolve_globals_in_ir(jl_array_t *stmts, jl_module_t *m, jl_svec_t *sparam_vals,
int binding_effects);

int get_next_backedge(jl_array_t *list, int i, jl_value_t** invokesig, jl_method_instance_t **caller);
int get_next_backedge(jl_array_t *list, int i, jl_value_t** invokesig, jl_method_instance_t **caller) JL_NOTSAFEPOINT;
int set_next_backedge(jl_array_t *list, int i, jl_value_t *invokesig, jl_method_instance_t *caller);
void push_backedge(jl_array_t *list, jl_value_t *invokesig, jl_method_instance_t *caller);

Expand Down
2 changes: 1 addition & 1 deletion src/method.c
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,7 @@ JL_DLLEXPORT jl_method_t *jl_new_method_uninit(jl_module_t *module)
// it will be the signature supplied in an `invoke` call.
// If you don't need `invokesig`, you can set it to NULL on input.
// Initialize iteration with `i = 0`. Returns `i` for the next backedge to be extracted.
int get_next_backedge(jl_array_t *list, int i, jl_value_t** invokesig, jl_method_instance_t **caller)
int get_next_backedge(jl_array_t *list, int i, jl_value_t** invokesig, jl_method_instance_t **caller) JL_NOTSAFEPOINT
{
jl_value_t *item = jl_array_ptr_ref(list, i);
if (jl_is_method_instance(item)) {
Expand Down

0 comments on commit 055be26

Please sign in to comment.