summaryrefslogtreecommitdiff
path: root/range.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-11-10 10:39:51 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-11-10 10:39:51 (GMT)
commit1a7aba1b47311f99a62dba5dfbf5518d6bb3c0cd (patch)
treed4f1018a302f5bc4ffcec65e4c9ccb06dbc1e9c5 /range.c
parent04a4fd8957f1e77ffaf6973b680c0697b85857a5 (diff)
range.c: check if range modifiable
* range.c (range_modify): frozen object cannot be modified. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56693 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'range.c')
-rw-r--r--range.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/range.c b/range.c
index 84a2dcc..6826499 100644
--- a/range.c
+++ b/range.c
@@ -80,6 +80,7 @@ rb_range_new(VALUE beg, VALUE end, int exclude_end)
static void
range_modify(VALUE range)
{
+ rb_check_frozen(range);
/* Ranges are immutable, so that they should be initialized only once. */
if (RANGE_EXCL(range) != Qnil) {
rb_name_err_raise("`initialize' called twice", range, ID2SYM(idInitialize));