From ced89c25ffc9ac748dc2dd336cce24d080ebf419 Mon Sep 17 00:00:00 2001 From: dearblue Date: Sun, 10 Jan 2021 10:50:22 +0900 Subject: Unified `pc` and `err` of `mrb_callinfo` This enhances self-containment. - Changed the `mrb_callinfo::pc` field to point to itself. Previously it indicated the return destination of the previous call level. `mrb_callinfo::pc` will now hold the address to its own `proc->body.irep->iseq`. - Removed `mrb_callinfo::err` field. This is because `mrb_callinfo::pc - 1` is semantically the same as the previous `err`. - The `pc0` and `pc_save` variables in `mrb_vm_exec()` are no longer needed and have been deleted. - It removes the argument because `cipush()` doesn't need to save the previous `pc`. --- include/mruby.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'include/mruby.h') diff --git a/include/mruby.h b/include/mruby.h index 3f78e66c6..b54e4f98e 100644 --- a/include/mruby.h +++ b/include/mruby.h @@ -152,8 +152,7 @@ typedef struct { mrb_sym mid; const struct RProc *proc; mrb_value *stack; - const mrb_code *pc; /* return address */ - const mrb_code *err; /* error position */ + const mrb_code *pc; /* current address on iseq of this proc */ int16_t argc; int16_t acc; union { -- cgit v1.2.3