diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-08-02 21:48:51 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-08-02 21:48:51 +0000 |
commit | 46085e913a90e2c9b3c7b01d8aea91cd43e76224 (patch) | |
tree | b9ecda477c941969c06b55f917caf4485da141e5 /vm.c | |
parent | a2078e7c54a178a7cf107ad8749b0a0c32e96f6b (diff) | |
download | ruby-46085e913a90e2c9b3c7b01d8aea91cd43e76224.tar.gz |
fix stack storing for root fibers.
* cont.c (root_fiber_alloc): this function is called by fiber_current()
and fiber_store(). fiber_current() should clear VM stack information
in a fiber data because runnning thread knows stack information and has
responsibility to manage it. However fiber_store() requires to remain
VM stack information in a fiber data because the responsibility to manage
VM stack is moved to the Fiber from the Thread (and switch to another
fiber).
* cont.c (root_fiber_alloc): save thread's fiber and root_fiber information.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59474 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm.c')
-rw-r--r-- | vm.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -90,6 +90,8 @@ VM_CFP_IN_HEAP_P(const rb_thread_t *th, const rb_control_frame_t *cfp) { const VALUE *start = th->ec.stack; const VALUE *end = (VALUE *)th->ec.stack + th->ec.stack_size; + VM_ASSERT(start != NULL); + if (start <= (VALUE *)cfp && (VALUE *)cfp < end) { return FALSE; } @@ -103,6 +105,8 @@ VM_EP_IN_HEAP_P(const rb_thread_t *th, const VALUE *ep) { const VALUE *start = th->ec.stack; const VALUE *end = (VALUE *)th->ec.cfp; + VM_ASSERT(start != NULL); + if (start <= ep && ep < end) { return FALSE; } |