aboutsummaryrefslogtreecommitdiffstats
path: root/vm_backtrace.c
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2021-06-16 22:07:05 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2021-06-17 10:13:40 +0900
commite4f891ce8d4833fea1e1f9abd69c2896d429a948 (patch)
tree81fb457e6485236fb55ab52628fdd8af9e0fcd64 /vm_backtrace.c
parent4e097226370ec93bd25823d6a0dd34963619b1b9 (diff)
downloadruby-e4f891ce8d4833fea1e1f9abd69c2896d429a948.tar.gz
Adjust styles [ci skip]
* --braces-after-func-def-line * --dont-cuddle-else * --procnames-start-lines * --space-after-for * --space-after-if * --space-after-while
Diffstat (limited to 'vm_backtrace.c')
-rw-r--r--vm_backtrace.c17
1 files changed, 11 insertions, 6 deletions
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 <internal: backtrace entry");
}
}
@@ -724,7 +728,8 @@ bt_iter_cfunc(void *ptr, const rb_control_frame_t *cfp, ID mid)
arg->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;
}
}