From d8b81e525658c56992fc7dcc3290e544e08933f0 Mon Sep 17 00:00:00 2001 From: usa Date: Sat, 25 Mar 2017 15:39:40 +0000 Subject: merge revision(s) 57360: [Backport #12884] class.c: non-keyword hash class * class.c (rb_extract_keywords): keep the class of non-keyword elements hash as the original. [ruby-core:77813] [Bug #12884] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_2@58092 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- class.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'class.c') diff --git a/class.c b/class.c index 13ab80dcd0..11a0f52998 100644 --- a/class.c +++ b/class.c @@ -1914,6 +1914,9 @@ rb_extract_keywords(VALUE *orighash) } st_foreach(rb_hash_tbl_raw(hash), separate_symbol, (st_data_t)&parthash); *orighash = parthash[1]; + if (parthash[1] && RBASIC_CLASS(hash) != rb_cHash) { + RBASIC_SET_CLASS(parthash[1], RBASIC_CLASS(hash)); + } return parthash[0]; } -- cgit v1.2.3