From a3fc6ae53cd466462f14ad5dcb46742210fb95f3 Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Sun, 26 Mar 2023 22:15:45 +0900 Subject: [PATCH] mruby-proc-ext/proc.c: use mrb_debug_get_position() --- mrbgems/mruby-proc-ext/src/proc.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/mrbgems/mruby-proc-ext/src/proc.c b/mrbgems/mruby-proc-ext/src/proc.c index 0ef754410..cf0989744 100644 --- a/mrbgems/mruby-proc-ext/src/proc.c +++ b/mrbgems/mruby-proc-ext/src/proc.c @@ -51,16 +51,13 @@ proc_inspect(mrb_state *mrb, mrb_value self) int32_t line; mrb_str_cat_lit(mrb, str, " "); - filename = mrb_debug_get_filename(mrb, irep, 0); - mrb_str_cat_cstr(mrb, str, filename ? filename : "-"); - mrb_str_cat_lit(mrb, str, ":"); - - line = mrb_debug_get_line(mrb, irep, 0); - if (line != -1) { + if (mrb_debug_get_position(mrb, irep, 0, &line, &filename)) { + mrb_str_cat_cstr(mrb, str, filename); + mrb_str_cat_lit(mrb, str, ":"); mrb_str_concat(mrb, str, mrb_fixnum_value(line)); } else { - mrb_str_cat_lit(mrb, str, "-"); + mrb_str_cat_lit(mrb, str, "-:-"); } }