summaryrefslogtreecommitdiff
path: root/array.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-12 03:04:11 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-12 03:04:11 +0000
commit7fa5e608d33d7b87763b37b4dc7793e2ae58c882 (patch)
tree94ff652cbd2984ef2505edf8d578db7785970153 /array.c
parentda786437a7be37f8807410a82071ace6089df97e (diff)
array.c: freeze in callback
* array.c (rb_ary_uniq_bang): must not be modified once frozen even in a callback method. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41247 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'array.c')
-rw-r--r--array.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/array.c b/array.c
index 9bdbe78..f3076d7 100644
--- a/array.c
+++ b/array.c
@@ -3981,6 +3981,7 @@ rb_ary_uniq_bang(VALUE ary)
if (RARRAY_LEN(ary) == (i = RHASH_SIZE(hash))) {
return Qnil;
}
+ rb_ary_modify(ary);
ARY_SET_LEN(ary, 0);
if (ARY_SHARED_P(ary) && !ARY_EMBED_P(ary)) {
rb_ary_unshare(ary);