Skip to content

Commit

Permalink
Try to remove likely-unused codepath in codegen for :method
Browse files Browse the repository at this point in the history
This codepath is odd. It derives a method name from the slotname
metadata and then does an implicit assignment to that slot. Worse,
as the comment indicates, the codepath is missing from the interpreter,
which will crash if it were to ever encounter such a piece of code.
I suspect this pattern is unused - I accidentally broke it badly
in (the as of yet unmerged PR) #54788 and neither tests nor pkgeval
noticed. So let's try removing it on master. If it turns out something
does depend on it, we can go the opposite way and implement it properly
in all the places that look at :method.
  • Loading branch information
Keno committed Aug 20, 2024
1 parent d4bd540 commit 5267b58
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions src/codegen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6412,13 +6412,6 @@ static jl_cgval_t emit_expr(jl_codectx_t &ctx, jl_value_t *expr, ssize_t ssaidx_
bp = julia_binding_gv(ctx, bnd);
bp = julia_binding_pvalue(ctx, bp);
}
else if (jl_is_slotnumber(mn) || jl_is_argument(mn)) {
// XXX: eval_methoddef does not have this code branch
int sl = jl_slot_number(mn)-1;
jl_varinfo_t &vi = ctx.slots[sl];
bp = vi.boxroot;
name = literal_pointer_val(ctx, (jl_value_t*)slot_symbol(ctx, sl));
}
if (bp) {
Value *mdargs[] = { name, literal_pointer_val(ctx, (jl_value_t*)mod), bp, literal_pointer_val(ctx, bnd) };
jl_cgval_t gf = mark_julia_type(
Expand Down

0 comments on commit 5267b58

Please sign in to comment.