1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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
This commit is contained in:
nobu 2016-08-03 08:15:08 +00:00
parent 8610ea732a
commit e821f97451
2 changed files with 9 additions and 0 deletions

View file

@ -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()

View file

@ -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)) {