aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-07-06 16:54:56 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-07-06 16:54:56 +0000
commit6ca78f0a1ca35066d7d7ac6ab1117d7c9522db73 (patch)
tree5f59ba42dd60be972b26f762c7d9eb1d3905a259
parenta4deb580f89dcfedfe530cbffd5e03f9bcd9ce80 (diff)
downloadruby-6ca78f0a1ca35066d7d7ac6ab1117d7c9522db73.tar.gz
* cont.c (fiber_init): initialize control frame correctly.
This fix does not affect any ordinal execution, but affects debug prints. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51165 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog6
-rw-r--r--cont.c9
2 files changed, 11 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 1bd1b7db4a..d2ac69160c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Tue Jul 7 01:52:14 2015 Koichi Sasada <ko1@atdot.net>
+
+ * 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@atdot.net>
* vm_insnhelper.c (vm_search_super_method): do not skip calling
diff --git a/cont.c b/cont.c
index 0ad91619bc..dc412ec46c 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;