From c4b4e77c72b42f0a69c6a825954ec768d1b2375b Mon Sep 17 00:00:00 2001
From: sorah <sorah@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>
Date: Thu, 26 Sep 2013 07:58:28 +0000
Subject: * insns.def (opt_regexpmatch2): Check String#=~ hasn't overridden  
 before calling rb_reg_match().

* test/ruby/test_string.rb: Test for above.

* vm.c (vm_init_redefined_flag): Add BOP flag for String#=~

[ruby-core:57385] [Bug #8953]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43052 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
---
 insns.def | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

(limited to 'insns.def')

diff --git a/insns.def b/insns.def
index a73501f245..740ff5dfa7 100644
--- a/insns.def
+++ b/insns.def
@@ -2098,7 +2098,8 @@ opt_regexpmatch2
 (VALUE obj2, VALUE obj1)
 (VALUE val)
 {
-    if (RB_TYPE_P(obj2, T_STRING)) {
+    if (RB_TYPE_P(obj2, T_STRING) &&
+	BASIC_OP_UNREDEFINED_P(BOP_MATCH, STRING_REDEFINED_OP_FLAG)) {
 	val = rb_reg_match(obj1, obj2);
     }
     else {
-- 
cgit v1.2.3

