Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/dump.c
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ static int has_backedge_to_worklist(jl_method_instance_t *mi, htable_t *visited)
for (i = 0; i < n; i++) {
jl_method_instance_t *be = (jl_method_instance_t*)jl_array_ptr_ref(mi->backedges, i);
if (has_backedge_to_worklist(be, visited)) {
bp = ptrhash_bp(visited, mi); // re-acquire since rehashing might change the location
*bp = (void*)((char*)HT_NOTFOUND + 2); // found
return 1;
}
Expand All @@ -286,10 +287,10 @@ static size_t queue_external_mis(jl_array_t *list)
{
size_t i, n = 0;
htable_t visited;
htable_new(&visited, 0);
if (list) {
assert(jl_is_array(list));
size_t n0 = jl_array_len(list);
htable_new(&visited, n0);
Comment on lines -289 to +293
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The htable_free below now access uninitialized memory and must be moved also

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Fixed in #44446

for (i = 0; i < n0; i++) {
jl_method_instance_t *mi = (jl_method_instance_t*)jl_array_ptr_ref(list, i);
assert(jl_is_method_instance(mi));
Expand Down Expand Up @@ -2640,7 +2641,7 @@ JL_DLLEXPORT int jl_save_incremental(const char *fname, jl_array_t *worklist)
arraylist_new(&reinit_list, 0);
htable_new(&edges_map, 0);
htable_new(&backref_table, 5000);
htable_new(&external_mis, 0);
htable_new(&external_mis, newly_inferred ? jl_array_len(newly_inferred) : 0);
ptrhash_put(&backref_table, jl_main_module, (char*)HT_NOTFOUND + 1);
backref_table_numel = 1;
jl_idtable_type = jl_base_module ? jl_get_global(jl_base_module, jl_symbol("IdDict")) : NULL;
Expand Down