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
@ -4358,6 +4358,7 @@ static VALUE
|
|||||||
vm_opt_regexpmatch2(VALUE recv, VALUE obj)
|
vm_opt_regexpmatch2(VALUE recv, VALUE obj)
|
||||||
{
|
{
|
||||||
if (CLASS_OF(recv) == rb_cString &&
|
if (CLASS_OF(recv) == rb_cString &&
|
||||||
|
CLASS_OF(obj) == rb_cRegexp &&
|
||||||
BASIC_OP_UNREDEFINED_P(BOP_MATCH, STRING_REDEFINED_OP_FLAG)) {
|
BASIC_OP_UNREDEFINED_P(BOP_MATCH, STRING_REDEFINED_OP_FLAG)) {
|
||||||
return rb_reg_match(obj, recv);
|
return rb_reg_match(obj, recv);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user