diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-08-17 07:47:27 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-08-17 07:47:27 +0000 |
commit | 59f1eaaf8fc39422f6ee8bbc666624e2ea754e7f (patch) | |
tree | bb7c3b6778bbbdd38722bc4acbd4d63119449a0c /vm.c | |
parent | 51954bd21f990be9a4b8aaabbedfca3f61b13f44 (diff) |
merge revision(s) 51263,51264: [Backport #11352]
* vm.c (m_core_hash_merge_ptr): copy the arguments to the machine
stack before rewinding the control frame pointer and leaving the
arguments outside valid region of the value stack.
[ruby-core:69969] [Bug #11352]
* vm.c (REWIND_CFP): keep the arguments region inside the valid
value stack. [ruby-core:69969] [Bug #11352]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@51601 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm.c')
-rw-r--r-- | vm.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -2269,7 +2269,11 @@ vm_define_method(rb_thread_t *th, VALUE obj, ID id, VALUE iseqval, #define REWIND_CFP(expr) do { \ rb_thread_t *th__ = GET_THREAD(); \ - th__->cfp++; expr; th__->cfp--; \ + VALUE *const curr_sp = (th__->cfp++)->sp; \ + VALUE *const saved_sp = th__->cfp->sp; \ + th__->cfp->sp = curr_sp; \ + expr; \ + (th__->cfp--)->sp = saved_sp; \ } while (0) static VALUE |