From e4f891ce8d4833fea1e1f9abd69c2896d429a948 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Wed, 16 Jun 2021 22:07:05 +0900 Subject: Adjust styles [ci skip] * --braces-after-func-def-line * --dont-cuddle-else * --procnames-start-lines * --space-after-for * --space-after-if * --space-after-while --- vm_backtrace.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'vm_backtrace.c') diff --git a/vm_backtrace.c b/vm_backtrace.c index 237b010408..19fb8f1c41 100644 --- a/vm_backtrace.c +++ b/vm_backtrace.c @@ -544,7 +544,7 @@ backtrace_each(const rb_execution_context_t *ec, } else { /* Ensure we don't look at frames beyond the ones requested */ - for(; from_last > 0 && start_cfp >= last_cfp; from_last--) { + for (; from_last > 0 && start_cfp >= last_cfp; from_last--) { last_cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(last_cfp); } @@ -610,7 +610,8 @@ backtrace_each(const rb_execution_context_t *ec, ignored_frames++; } } - } else { + } + else { /* No ignored frames before start frame, just decrement start */ start -= ignored_frames; } @@ -629,7 +630,8 @@ backtrace_each(const rb_execution_context_t *ec, if (cfp->iseq) { if (cfp->pc) { iter_iseq(arg, cfp); - } else { + } + else { i--; } } @@ -697,12 +699,14 @@ bt_iter_iseq_skip_internal(void *ptr, const rb_control_frame_t *cfp) loc->body.iseq.iseq = cfp->iseq; loc->body.iseq.lineno.pc = cfp->pc; arg->prev_loc = loc; - } else if (arg->prev_cfp) { + } + else if (arg->prev_cfp) { loc->type = LOCATION_TYPE_ISEQ; loc->body.iseq.iseq = arg->prev_cfp->iseq; loc->body.iseq.lineno.pc = arg->prev_cfp->pc; arg->prev_loc = loc; - } else { + } + else { rb_bug("No non-internal backtrace entry before an init_loc->body.iseq.iseq = iseq; arg->init_loc->body.iseq.lineno.pc = pc; loc->body.cfunc.prev_loc = arg->prev_loc = arg->init_loc; - } else { + } + else { loc->body.cfunc.prev_loc = NULL; } } -- cgit v1.2.3