Skip to content

Commit ad3014d

Browse files
KenoKristofferC
authored andcommitted
Try to remove likely-unused codepath in codegen for :method (#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) #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.
1 parent 8146235 commit ad3014d

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

src/codegen.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6412,13 +6412,6 @@ static jl_cgval_t emit_expr(jl_codectx_t &ctx, jl_value_t *expr, ssize_t ssaidx_
64126412
bp = julia_binding_gv(ctx, bnd);
64136413
bp = julia_binding_pvalue(ctx, bp);
64146414
}
6415-
else if (jl_is_slotnumber(mn) || jl_is_argument(mn)) {
6416-
// XXX: eval_methoddef does not have this code branch
6417-
int sl = jl_slot_number(mn)-1;
6418-
jl_varinfo_t &vi = ctx.slots[sl];
6419-
bp = vi.boxroot;
6420-
name = literal_pointer_val(ctx, (jl_value_t*)slot_symbol(ctx, sl));
6421-
}
64226415
if (bp) {
64236416
Value *mdargs[] = { name, literal_pointer_val(ctx, (jl_value_t*)mod), bp, literal_pointer_val(ctx, bnd) };
64246417
jl_cgval_t gf = mark_julia_type(

0 commit comments

Comments
 (0)