From 096213b2f152c71a8141e450225530c3fa1163a7 Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Fri, 27 Mar 2026 17:15:48 +0100 Subject: Revert "Reapply "[Feature #6012] Extend `source_location` for end position" This reverts commit 8f5e0d8ff82ff63d60da445826fa44be3d8d0820. --- proc.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'proc.c') diff --git a/proc.c b/proc.c index 09b3847d2d..35b1f3b608 100644 --- a/proc.c +++ b/proc.c @@ -1515,20 +1515,14 @@ proc_eq(VALUE self, VALUE other) static VALUE iseq_location(const rb_iseq_t *iseq) { - VALUE loc[5]; - int i = 0; + VALUE loc[2]; if (!iseq) return Qnil; rb_iseq_check(iseq); - loc[i++] = rb_iseq_path(iseq); - const rb_code_location_t *cl = &ISEQ_BODY(iseq)->location.code_location; - loc[i++] = RB_INT2NUM(cl->beg_pos.lineno); - loc[i++] = RB_INT2NUM(cl->beg_pos.column); - loc[i++] = RB_INT2NUM(cl->end_pos.lineno); - loc[i++] = RB_INT2NUM(cl->end_pos.column); - RUBY_ASSERT_ALWAYS(i == numberof(loc)); - - return rb_ary_new_from_values(i, loc); + loc[0] = rb_iseq_path(iseq); + loc[1] = RB_INT2NUM(ISEQ_BODY(iseq)->location.first_lineno); + + return rb_ary_new4(2, loc); } VALUE -- cgit v1.2.3