Skip to content

Commit

Permalink
Omit NULL check of e->cxt in OP_RETURN_BLK
Browse files Browse the repository at this point in the history
Since `mrb->c` is never `NULL`, there is no need to check it beforehand.
  • Loading branch information
dearblue committed Feb 24, 2024
1 parent 6248e9c commit e94eef6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/vm.c
Original file line number Diff line number Diff line change
Expand Up @@ -2311,7 +2311,7 @@ mrb_vm_exec(mrb_state *mrb, const struct RProc *proc, const mrb_code *pc)
if (MRB_PROC_ENV_P(dst)) {
struct REnv *e = MRB_PROC_ENV(dst);

if (!MRB_ENV_ONSTACK_P(e) || (e->cxt && e->cxt != mrb->c)) {
if (!MRB_ENV_ONSTACK_P(e) || e->cxt != mrb->c) {
localjump_error(mrb, LOCALJUMP_ERROR_RETURN);
goto L_RAISE;
}
Expand Down

0 comments on commit e94eef6

Please sign in to comment.