Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check that MethodInstance.def is Method #46148

Closed
wants to merge 1 commit into from
Closed
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: 4 additions & 1 deletion src/dump.c
Original file line number Diff line number Diff line change
Expand Up @@ -1298,7 +1298,10 @@ static void jl_collect_backedges( /* edges */ jl_array_t *s, /* ext_targets */ j
for (i = 0; i < edges_map.size; i += 2) {
jl_method_instance_t *caller = (jl_method_instance_t*)table[i];
jl_array_t *callees = (jl_array_t*)table[i + 1];
if (callees != HT_NOTFOUND && (module_in_worklist(caller->def.method->module) || method_instance_in_queue(caller))) {
if (callees == HT_NOTFOUND)
continue;
assert(jl_is_method_instance(caller));
if (jl_is_method(caller->def.method) && (module_in_worklist(caller->def.method->module) || method_instance_in_queue(caller))) {
Comment on lines +1303 to +1304
Copy link
Member

Choose a reason for hiding this comment

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

AFIAK, we should never see this happen (since Core.Compiler.store_backedges shouldn't make these edges). Though we could also have jl_method_instance_add_backedge ensure that it does not create them too.

Suggested change
assert(jl_is_method_instance(caller));
if (jl_is_method(caller->def.method) && (module_in_worklist(caller->def.method->module) || method_instance_in_queue(caller))) {
assert(jl_is_method_instance(caller) && jl_is_method(caller->def.method));
if (module_in_worklist(caller->def.method->module) || method_instance_in_queue(caller))) {

size_t i, l = jl_array_len(callees);
for (i = 0; i < l; i++) {
jl_value_t *c = jl_array_ptr_ref(callees, i);
Expand Down