ruby-changes:39084
From: ko1 <ko1@a...>
Date: Tue, 7 Jul 2015 01:55:07 +0900 (JST)
Subject: [ruby-changes:39084] ko1:r51165 (trunk): * cont.c (fiber_init): initialize control frame correctly.
ko1 2015-07-07 01:54:56 +0900 (Tue, 07 Jul 2015) New Revision: 51165 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=51165 Log: * cont.c (fiber_init): initialize control frame correctly. This fix does not affect any ordinal execution, but affects debug prints. Modified files: trunk/ChangeLog trunk/cont.c Index: ChangeLog =================================================================== --- ChangeLog (revision 51164) +++ ChangeLog (revision 51165) @@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Tue Jul 7 01:52:14 2015 Koichi Sasada <ko1@a...> + + * cont.c (fiber_init): initialize control frame correctly. + This fix does not affect any ordinal execution, but + affects debug prints. + Mon Jul 6 17:59:05 2015 Koichi Sasada <ko1@a...> * vm_insnhelper.c (vm_search_super_method): do not skip calling Index: cont.c =================================================================== --- cont.c (revision 51164) +++ cont.c (revision 51165) @@ -1196,14 +1196,15 @@ fiber_init(VALUE fibval, VALUE proc) https://github.com/ruby/ruby/blob/trunk/cont.c#L1196 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; -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/