diff options
author | Alan Wu <XrXr@users.noreply.github.com> | 2023-08-24 17:32:45 -0400 |
---|---|---|
committer | Alan Wu <XrXr@users.noreply.github.com> | 2023-08-24 17:37:07 -0400 |
commit | ebb9034710f2f0e9ce27b451daa1cd279232de5c (patch) | |
tree | a28c9e26489d1343c8af92a91d19012138b600a4 /vm.c | |
parent | 05e827427f8eaf3958ba8d29c96ae1125e06fbe0 (diff) |
Remove cfp parameter from hook_before_rewind()
It's only used once, and it has to equal `ec->cfp`, so just use that.
Diffstat (limited to 'vm.c')
-rw-r--r-- | vm.c | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -2185,14 +2185,13 @@ frame_name(const rb_control_frame_t *cfp) // cfp_returning_with_value: // Whether cfp is the last frame in the unwinding process for a non-local return. static void -hook_before_rewind(rb_execution_context_t *ec, const rb_control_frame_t *cfp, - bool cfp_returning_with_value, int state, struct vm_throw_data *err) +hook_before_rewind(rb_execution_context_t *ec, bool cfp_returning_with_value, int state, struct vm_throw_data *err) { if (state == TAG_RAISE && RBASIC(err)->klass == rb_eSysStackError) { return; } else { - const rb_iseq_t *iseq = cfp->iseq; + const rb_iseq_t *iseq = ec->cfp->iseq; rb_hook_list_t *local_hooks = iseq->aux.exec.local_hooks; switch (VM_FRAME_TYPE(ec->cfp)) { @@ -2498,7 +2497,7 @@ vm_exec_handle_exception(rb_execution_context_t *ec, enum ruby_tag_type state, V ec->errinfo = Qnil; THROW_DATA_CATCH_FRAME_SET(err, cfp + 1); // cfp == escape_cfp here so calling with cfp_returning_with_value = true - hook_before_rewind(ec, ec->cfp, true, state, err); + hook_before_rewind(ec, true, state, err); rb_vm_pop_frame(ec); return THROW_DATA_VAL(err); } @@ -2631,7 +2630,7 @@ vm_exec_handle_exception(rb_execution_context_t *ec, enum ruby_tag_type state, V return Qundef; } else { - hook_before_rewind(ec, ec->cfp, (cfp == escape_cfp), state, err); + hook_before_rewind(ec, (cfp == escape_cfp), state, err); if (VM_FRAME_FINISHED_P(ec->cfp)) { rb_vm_pop_frame(ec); |