Skip to content

Commit

Permalink
Fix embarrassing bug in jl_copy_ast (JuliaLang#41113)
Browse files Browse the repository at this point in the history
This function was copying the code, but not actually assigning the
newly copied code into the CodeInfo. This should fix crashes and
mysterious 265-like issues in Diffractor.
  • Loading branch information
Keno committed Jun 7, 2021
1 parent e8cbee0 commit 325475c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/ast.c
Original file line number Diff line number Diff line change
Expand Up @@ -933,6 +933,8 @@ JL_DLLEXPORT jl_value_t *jl_copy_ast(jl_value_t *expr)
jl_array_ptr_ref(new_code, i)
));
}
new_ci->code = new_code;
jl_gc_wb(new_ci, new_code);
new_ci->slotnames = jl_array_copy(new_ci->slotnames);
jl_gc_wb(new_ci, new_ci->slotnames);
new_ci->slotflags = jl_array_copy(new_ci->slotflags);
Expand Down

0 comments on commit 325475c

Please sign in to comment.