summaryrefslogtreecommitdiff
path: root/range.c
diff options
context:
space:
mode:
Diffstat (limited to 'range.c')
-rw-r--r--range.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/range.c b/range.c
index 224e5d3..17d2992 100644
--- a/range.c
+++ b/range.c
@@ -58,6 +58,10 @@ range_init(VALUE range, VALUE beg, VALUE end, VALUE exclude_end)
RANGE_SET_EXCL(range, exclude_end);
RANGE_SET_BEG(range, beg);
RANGE_SET_END(range, end);
+
+ if (CLASS_OF(range) == rb_cRange) {
+ rb_obj_freeze(range);
+ }
}
VALUE