summaryrefslogtreecommitdiff
path: root/re.c
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2023-02-09 16:38:23 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2023-02-09 19:21:24 +0900
commitb49cd843110fd48486ab97085ab475a98780cb45 (patch)
treeab5d110db38198ca2e2f6226b8f1267bd0b1ee04 /re.c
parent5991af204c2b27d7d5343177e6ad247d5954a6c0 (diff)
downloadruby-b49cd843110fd48486ab97085ab475a98780cb45.tar.gz
Remove `REG_LITERAL` flag
All `Regexp` literals are frozen now.
Diffstat (limited to 're.c')
-rw-r--r--re.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/re.c b/re.c
index a53493b0d6..fb0f5034f1 100644
--- a/re.c
+++ b/re.c
@@ -282,7 +282,6 @@ rb_memsearch(const void *x0, long m, const void *y0, long n, rb_encoding *enc)
return rb_memsearch_qs(x0, m, y0, n);
}
-#define REG_LITERAL FL_USER5
#define REG_ENCODING_NONE FL_USER6
#define KCODE_FIXED FL_USER4
@@ -3191,8 +3190,6 @@ rb_reg_initialize(VALUE obj, const char *s, long len, rb_encoding *enc,
rb_encoding *a_enc = rb_ascii8bit_encoding();
rb_check_frozen(obj);
- if (FL_TEST(obj, REG_LITERAL))
- rb_raise(rb_eSecurityError, "can't modify literal regexp");
if (re->ptr)
rb_raise(rb_eTypeError, "already initialized regexp");
re->ptr = 0;
@@ -3358,7 +3355,6 @@ rb_reg_compile(VALUE str, int options, const char *sourcefile, int sourceline)
rb_set_errinfo(rb_reg_error_desc(str, options, err));
return Qnil;
}
- FL_SET(re, REG_LITERAL);
rb_obj_freeze(re);
return re;
}