From 79e3d6bb9e007fc97153c1097daf78e9a201a642 Mon Sep 17 00:00:00 2001 From: "Urabe, Shyouhei" Date: Wed, 19 Sep 2018 16:46:44 +0900 Subject: fix shortcut condition rb_reg_match expects its first argument to be a Regexp instance. Should check that. --- vm_insnhelper.c | 1 + 1 file changed, 1 insertion(+) (limited to 'vm_insnhelper.c') diff --git a/vm_insnhelper.c b/vm_insnhelper.c index 6a198f94e4..1c74b121e8 100644 --- a/vm_insnhelper.c +++ b/vm_insnhelper.c @@ -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); } -- cgit v1.2.3