mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
fix shortcut condition
rb_reg_match expects its first argument to be a Regexp instance. Should check that.
This commit is contained in:
parent
ec80d5c4f3
commit
79e3d6bb9e
Notes:
git
2019-09-02 13:57:07 +09:00
1 changed files with 1 additions and 0 deletions
|
@ -4358,6 +4358,7 @@ static VALUE
|
|||
vm_opt_regexpmatch2(VALUE recv, VALUE obj)
|
||||
{
|
||||
if (CLASS_OF(recv) == rb_cString &&
|
||||
CLASS_OF(obj) == rb_cRegexp &&
|
||||
BASIC_OP_UNREDEFINED_P(BOP_MATCH, STRING_REDEFINED_OP_FLAG)) {
|
||||
return rb_reg_match(obj, recv);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue