summaryrefslogtreecommitdiff
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
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
-rw-r--r--ChangeLog5
-rw-r--r--object.c4
2 files changed, 9 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 11ae351..edad3d0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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()
diff --git a/object.c b/object.c
index a4a87db..c58a46b 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)) {