summaryrefslogtreecommitdiff
path: root/object.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-08-03 08:15:08 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-08-03 08:15:08 +0000
commite821f974511fc7577f467f6178ccf2de99e355b2 (patch)
tree4cf2af4c2ef1b5d878e0fcc1e697206a67f4cfff /object.c
parent8610ea732ad318e6572f20e39cbf385b4bb286bb (diff)
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
Diffstat (limited to 'object.c')
-rw-r--r--object.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/object.c b/object.c
index a4a87db4d6..c58a46b293 100644
--- a/object.c
+++ b/object.c
@@ -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)) {