* vm_insnhelper.c (check_match): Fix SEGV with VM_CHECKMATCH_TYPE_CASE
and class of `pattern` has `method_missing` [Bug #8882] [ruby-core:58606] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43913 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
92b4a05e07
commit
205399b0f4
@ -1,3 +1,9 @@
|
||||
Fri Nov 29 17:53:22 2013 Shota Fukumori <her@sorah.jp>
|
||||
|
||||
* vm_insnhelper.c (check_match): Fix SEGV with VM_CHECKMATCH_TYPE_CASE
|
||||
and class of `pattern` has `method_missing`
|
||||
[Bug #8882] [ruby-core:58606]
|
||||
|
||||
Fri Nov 29 17:06:09 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* vm_eval.c (rb_yield_block): yield block with rb_block_call_func
|
||||
|
@ -947,7 +947,13 @@ check_match(VALUE pattern, VALUE target, enum vm_check_match_type type)
|
||||
case VM_CHECKMATCH_TYPE_CASE: {
|
||||
VALUE defined_class;
|
||||
rb_method_entry_t *me = rb_method_entry_with_refinements(CLASS_OF(pattern), idEqq, &defined_class);
|
||||
return vm_call0(GET_THREAD(), pattern, idEqq, 1, &target, me, defined_class);
|
||||
if (me) {
|
||||
return vm_call0(GET_THREAD(), pattern, idEqq, 1, &target, me, defined_class);
|
||||
}
|
||||
else {
|
||||
/* fallback to funcall (e.g. method_missing) */
|
||||
return rb_funcall2(pattern, idEqq, 1, &target);
|
||||
}
|
||||
}
|
||||
default:
|
||||
rb_bug("check_match: unreachable");
|
||||
|
Loading…
x
Reference in New Issue
Block a user