Skip to content

Commit

Permalink
Try to remove likely-unused codepath in codegen for :method (JuliaLan…
Browse files Browse the repository at this point in the history
…g#55532)

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) JuliaLang#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 authored and udesou committed Aug 28, 2024
1 parent 5963dc0 commit 9b12c98
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 9b12c98

Please sign in to comment.