mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Add macro MRB_ENV_UNSHARE_STACK instead of assigning -1 directly.
This commit is contained in:
@@ -21,6 +21,7 @@ struct REnv {
|
||||
};
|
||||
|
||||
#define MRB_ENV_STACK_LEN(e) ((e)->flags)
|
||||
#define MRB_ENV_UNSHARE_STACK(e) ((e)->cioff = -1)
|
||||
|
||||
struct RProc {
|
||||
MRB_OBJECT_HEADER;
|
||||
|
||||
@@ -17,7 +17,7 @@ mrb_proc_new_cfunc_with_env(mrb_state *mrb, mrb_func_t f, mrb_int argc, const mr
|
||||
p->env = e;
|
||||
mrb_gc_arena_restore(mrb, ai);
|
||||
|
||||
e->cioff = -1;
|
||||
MRB_ENV_UNSHARE_STACK(e);
|
||||
MRB_ENV_STACK_LEN(e) = argc;
|
||||
e->stack = (mrb_value*)mrb_malloc(mrb, sizeof(mrb_value) * argc);
|
||||
for (i = 0; i < argc; ++i) {
|
||||
|
||||
Reference in New Issue
Block a user