aboutsummaryrefslogtreecommitdiffstats
path: root/re.c
diff options
context:
space:
mode:
Diffstat (limited to 're.c')
-rw-r--r--re.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/re.c b/re.c
index 436316c2d4..92eba92d1b 100644
--- a/re.c
+++ b/re.c
@@ -3323,6 +3323,7 @@ rb_reg_match_m(int argc, VALUE *argv, VALUE re)
pos = 0;
}
+ str = SYMBOL_P(str) ? rb_sym2str(str) : StringValue(str);
pos = reg_match_pos(re, &str, pos);
if (pos < 0) {
rb_backref_set(Qnil);
@@ -3368,7 +3369,6 @@ rb_reg_match_p(VALUE re, VALUE str, long pos)
const UChar *start, *end;
int tmpreg;
- if (NIL_P(str)) return Qfalse;
str = SYMBOL_P(str) ? rb_sym2str(str) : StringValue(str);
if (pos) {
if (pos < 0) {