diff options
author | NARUSE, Yui <[email protected]> | 2019-12-04 01:26:29 +0900 |
---|---|---|
committer | NARUSE, Yui <[email protected]> | 2019-12-04 06:40:54 +0900 |
commit | 8852fa876039ed177fd5e867f36177d8a9ff411c (patch) | |
tree | 56dd2c368bfe7cc694bf333c3ef987e2fee1b727 /re.c | |
parent | 08074eb71229b4c9f669f7bfb215bbb43525bfc0 (diff) |
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.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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) { |