mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
mruby-fiber (fiber_to_s): retrieve position from terminated fibers; #6105
Since `cxt->ci` points to the last active callinfo, `cxt->ci == cxt->cibase` does not mean it does not have correct `proc` information, so we have removed the `f->cxt->ci > f->cxt->cibase` check. Instead, just in case `proc` does not have `irep` information, we try to confirm `proc` does not point to `CFUNC` nor is not an alias.
This commit is contained in:
@@ -381,8 +381,9 @@ fiber_to_s(mrb_state *mrb, mrb_value self)
|
||||
|
||||
const char *file;
|
||||
int32_t line;
|
||||
if (f->cxt->ci > f->cxt->cibase &&
|
||||
mrb_debug_get_position(mrb, f->cxt->cibase->proc->body.irep, 0, &line, &file)) {
|
||||
const struct RProc *p = f->cxt->cibase->proc;
|
||||
if (!MRB_PROC_CFUNC_P(p) && !MRB_PROC_ALIAS_P(p) &&
|
||||
mrb_debug_get_position(mrb, p->body.irep, 0, &line, &file)) {
|
||||
mrb_str_cat_cstr(mrb, s, file);
|
||||
mrb_str_cat_lit(mrb, s, ":");
|
||||
char buf[16];
|
||||
|
||||
Reference in New Issue
Block a user