summaryrefslogtreecommitdiff
path: root/vm.c
diff options
context:
space:
mode:
authorcharliesome <charliesome@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-09-26 07:39:48 +0000
committercharliesome <charliesome@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-09-26 07:39:48 +0000
commitb18151cf537680862dec24899a3dee469356db57 (patch)
tree9c23ae9f0287b3e8ba17b34034e0f6fefead851c /vm.c
parent4190cdddbbe85c3097b30eda2a528cc9482bdfa4 (diff)
downloadruby-b18151cf537680862dec24899a3dee469356db57.tar.gz
* insns.def (opt_regexpmatch1): check Regexp#=~ is not defined before
calling rb_reg_match() * test/ruby/test_regexp.rb: add test * vm.c (ruby_vm_redefined_flag): change type to short[] * vm.c (vm_redefinition_check_flag): return REGEXP_REDEFINED_OP_FLAG if klass == rb_cRegexp * vm.c (vm_init_redefined_flag): setup BOP flag for Regexp#=~ * vm_insnhelper.h: add REGEXP_REDEFINED_OP_FLAG [ruby-core:57385] [Bug #8953] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43050 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm.c')
-rw-r--r--vm.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/vm.c b/vm.c
index 3c50daa2fe..d647ab4a2a 100644
--- a/vm.c
+++ b/vm.c
@@ -99,7 +99,7 @@ VALUE rb_cEnv;
VALUE rb_mRubyVMFrozenCore;
VALUE ruby_vm_const_missing_count = 0;
-char ruby_vm_redefined_flag[BOP_LAST_];
+short ruby_vm_redefined_flag[BOP_LAST_];
rb_thread_t *ruby_current_thread = 0;
rb_vm_t *ruby_current_vm = 0;
rb_event_flag_t ruby_vm_event_flags;
@@ -1016,6 +1016,7 @@ vm_redefinition_check_flag(VALUE klass)
if (klass == rb_cBignum) return BIGNUM_REDEFINED_OP_FLAG;
if (klass == rb_cSymbol) return SYMBOL_REDEFINED_OP_FLAG;
if (klass == rb_cTime) return TIME_REDEFINED_OP_FLAG;
+ if (klass == rb_cRegexp) return REGEXP_REDEFINED_OP_FLAG;
return 0;
}
@@ -1094,6 +1095,7 @@ vm_init_redefined_flag(void)
OP(Size, SIZE), (C(Array), C(String), C(Hash));
OP(EmptyP, EMPTY_P), (C(Array), C(String), C(Hash));
OP(Succ, SUCC), (C(Fixnum), C(String), C(Time));
+ OP(EqTilde, MATCH), (C(Regexp));
#undef C
#undef OP
}