Skip to content

Commit

Permalink
Restore world age increment for :toplevel and :module
Browse files Browse the repository at this point in the history
  • Loading branch information
Keno committed Nov 10, 2024
1 parent 9534339 commit 4330bad
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/toplevel.c
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ static jl_value_t *jl_eval_module_expr(jl_module_t *parent_module, jl_expr_t *ex

for (int i = 0; i < jl_array_nrows(exprs); i++) {
// process toplevel form
ct->world_age = jl_atomic_load_relaxed(&jl_world_counter);
form = jl_expand_stmt_with_loc(jl_array_ptr_ref(exprs, i), newm, filename, lineno);
(void)jl_toplevel_eval_flex(newm, form, 1, 1, &filename, &lineno);
}
Expand Down Expand Up @@ -1010,6 +1011,7 @@ JL_DLLEXPORT jl_value_t *jl_toplevel_eval_flex(jl_module_t *JL_NONNULL m, jl_val
jl_value_t *res = jl_nothing;
int i;
for (i = 0; i < jl_array_nrows(ex->args); i++) {
ct->world_age = jl_atomic_load_acquire(&jl_world_counter);
res = jl_toplevel_eval_flex(m, jl_array_ptr_ref(ex->args, i), fast, 0, toplevel_filename, toplevel_lineno);
}
JL_GC_POP();
Expand Down Expand Up @@ -1199,6 +1201,7 @@ static jl_value_t *jl_parse_eval_all(jl_module_t *module, jl_value_t *text,
jl_lineno = lineno;
continue;
}
ct->world_age = jl_atomic_load_relaxed(&jl_world_counter);
expression = jl_expand_with_loc_warn(expression, module,
jl_string_data(filename), lineno);
result = jl_toplevel_eval_flex(module, expression, 1, 1, &filename_str, &lineno);
Expand Down

0 comments on commit 4330bad

Please sign in to comment.