aboutsummaryrefslogtreecommitdiffstats
path: root/re.c
diff options
context:
space:
mode:
authorNARUSE, Yui <naruse@airemix.jp>2019-12-04 01:26:29 +0900
committerNARUSE, Yui <naruse@airemix.jp>2019-12-04 06:40:54 +0900
commit8852fa876039ed177fd5e867f36177d8a9ff411c (patch)
tree56dd2c368bfe7cc694bf333c3ef987e2fee1b727 /re.c
parent08074eb71229b4c9f669f7bfb215bbb43525bfc0 (diff)
downloadruby-8852fa876039ed177fd5e867f36177d8a9ff411c.tar.gz
Revert "Regexp#match{?} with nil raises TypeError as String, Symbol (#1506)"
This reverts commit 2a22a6b2d8465934e75520a7fdcf522d50890caf. Revert [Feature #13083]
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 6dfb9f273f..b15c3a07a8 100644
--- a/re.c
+++ b/re.c
@@ -3299,7 +3299,6 @@ 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);
@@ -3345,6 +3344,7 @@ 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) {