aboutsummaryrefslogtreecommitdiffstats
path: root/class.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-01-18 03:38:52 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-01-18 03:38:52 +0000
commitb97ee6c636053d334860cd7d4833cd9531552c37 (patch)
treeadbaf37e68a52d46be17cf5f1d2c28feabb58ce6 /class.c
parent6f29e0ee09a26df04352106962d612a9b4335dbb (diff)
downloadruby-b97ee6c636053d334860cd7d4833cd9531552c37.tar.gz
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/trunk@57360 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'class.c')
-rw-r--r--class.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/class.c b/class.c
index 43530c9461..5c54b0c7d4 100644
--- a/class.c
+++ b/class.c
@@ -1841,6 +1841,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];
}