diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-08-03 08:15:08 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-08-03 08:15:08 +0000 |
commit | e75f97c1d90a5d2a64b6ac844328fdda09cd080a (patch) | |
tree | 4cf2af4c2ef1b5d878e0fcc1e697206a67f4cfff | |
parent | 0c0ca594c586e42f4ebfe002b4b7d212d1073444 (diff) | |
download | ruby-e75f97c1d90a5d2a64b6ac844328fdda09cd080a.tar.gz |
object.c: restrict freeze option
* object.c (rb_obj_clone2): restrict freeze option to true other
than false which only has the effect. [Feature #12300]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55808 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | object.c | 4 |
2 files changed, 9 insertions, 0 deletions
@@ -1,3 +1,8 @@ +Wed Aug 3 17:15:06 2016 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * object.c (rb_obj_clone2): restrict freeze option to true other + than false which only has the effect. [Feature #12300] + Wed Aug 3 10:47:07 2016 Koichi Sasada <ko1@atdot.net> * vm_core.h: introduce VM_FRAME_RUBYFRAME_P() @@ -339,6 +339,10 @@ rb_obj_clone2(int argc, VALUE *argv, VALUE obj) if (!NIL_P(opt)) { rb_get_kwargs(opt, keyword_ids, 0, 1, kwargs); kwfreeze = kwargs[0]; + if (kwfreeze != Qundef && kwfreeze != Qtrue && kwfreeze != Qfalse) { + rb_raise(rb_eArgError, "unexpected value for freeze: %s", + rb_builtin_class_name(kwfreeze)); + } } if (rb_special_const_p(obj)) { |