summaryrefslogtreecommitdiff
path: root/cont.c
diff options
context:
space:
mode:
Diffstat (limited to 'cont.c')
-rw-r--r--cont.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/cont.c b/cont.c
index 0ad9161..dc412ec 100644
--- a/cont.c
+++ b/cont.c
@@ -1196,14 +1196,15 @@ fiber_init(VALUE fibval, VALUE proc)
th->cfp = (void *)(th->stack + th->stack_size);
th->cfp--;
th->cfp->pc = 0;
- th->cfp->sp = th->stack + 1;
+ th->cfp->sp = th->stack + 2;
#if VM_DEBUG_BP_CHECK
th->cfp->bp_check = 0;
#endif
- th->cfp->ep = th->stack;
- *th->cfp->ep = VM_ENVVAL_BLOCK_PTR(0);
+ th->cfp->ep = th->stack + 1;
+ th->cfp->ep[ 0] = VM_ENVVAL_BLOCK_PTR(0);
+ th->cfp->ep[-1] = 0;
th->cfp->self = Qnil;
- th->cfp->flag = 0;
+ th->cfp->flag = VM_FRAME_MAGIC_DUMMY | VM_FRAME_FLAG_FINISH;
th->cfp->iseq = 0;
th->cfp->proc = 0;
th->cfp->block_iseq = 0;