diff options
author | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-04-24 01:40:51 +0000 |
---|---|---|
committer | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-04-24 01:40:51 +0000 |
commit | a15fd1d9f2b4213417a5e3902fa7efe1195cdd05 (patch) | |
tree | 2b635425fb05d3325a5c58ed0c0de6801f950ce3 /insns.def | |
parent | b3209c258eddc093ffdcbf77ee079cdc93f094ae (diff) |
revert newhash refactoring
We need to fix GC bug before merging this. Revert revisions
58452, 58435, 58434, 58428, 58427 in this order.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58463 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'insns.def')
-rw-r--r-- | insns.def | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -492,13 +492,16 @@ newhash (...) (VALUE val) // inc += 1 - num; { + rb_num_t i; + RUBY_DTRACE_CREATE_HOOK(HASH, num); - if (num) { - val = rb_hash_new_from_values(num, STACK_ADDR_FROM_TOP(num)); - } - else { - val = rb_hash_new(); + val = rb_hash_new(); + + for (i = num; i > 0; i -= 2) { + const VALUE v = TOPN(i - 2); + const VALUE k = TOPN(i - 1); + rb_hash_aset(val, k, v); } POPN(num); } |