ruby-changes:43735
From: nobu <ko1@a...>
Date: Wed, 3 Aug 2016 17:15:14 +0900 (JST)
Subject: [ruby-changes:43735] nobu:r55808 (trunk): object.c: restrict freeze option
nobu 2016-08-03 17:15:08 +0900 (Wed, 03 Aug 2016) New Revision: 55808 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=55808 Log: 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] Modified files: trunk/ChangeLog trunk/object.c Index: object.c =================================================================== --- object.c (revision 55807) +++ object.c (revision 55808) @@ -339,6 +339,10 @@ rb_obj_clone2(int argc, VALUE *argv, VAL https://github.com/ruby/ruby/blob/trunk/object.c#L339 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)) { Index: ChangeLog =================================================================== --- ChangeLog (revision 55807) +++ ChangeLog (revision 55808) @@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Wed Aug 3 17:15:06 2016 Nobuyoshi Nakada <nobu@r...> + + * 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@a...> * vm_core.h: introduce VM_FRAME_RUBYFRAME_P() -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/