1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

accepts ec as first parameter.

* vm_insnhelper.c (vm_check_match): accepts `ec` as first parameter.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60794 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ko1 2017-11-16 06:10:31 +00:00
parent 1ae69a2064
commit 2fb4c36c44
2 changed files with 6 additions and 6 deletions

View file

@ -759,7 +759,7 @@ checkmatch
(VALUE target, VALUE pattern)
(VALUE result)
{
result = vm_check_match(target, pattern, flag);
result = vm_check_match(ec, target, pattern, flag);
}
/**

View file

@ -1464,7 +1464,7 @@ rb_eql_opt(VALUE obj1, VALUE obj2)
static VALUE vm_call0(rb_execution_context_t *ec, VALUE, ID, int, const VALUE*, const rb_callable_method_entry_t *);
static VALUE
check_match(VALUE pattern, VALUE target, enum vm_check_match_type type)
check_match(rb_execution_context_t *ec, VALUE pattern, VALUE target, enum vm_check_match_type type)
{
switch (type) {
case VM_CHECKMATCH_TYPE_WHEN:
@ -1478,7 +1478,7 @@ check_match(VALUE pattern, VALUE target, enum vm_check_match_type type)
const rb_callable_method_entry_t *me =
rb_callable_method_entry_with_refinements(CLASS_OF(pattern), idEqq, NULL);
if (me) {
return vm_call0(GET_EC(), pattern, idEqq, 1, &target, me);
return vm_call0(ec, pattern, idEqq, 1, &target, me);
}
else {
/* fallback to funcall (e.g. method_missing) */
@ -2979,7 +2979,7 @@ vm_splat_array(VALUE flag, VALUE ary)
}
static VALUE
vm_check_match(VALUE target, VALUE pattern, rb_num_t flag)
vm_check_match(rb_execution_context_t *ec, VALUE target, VALUE pattern, rb_num_t flag)
{
enum vm_check_match_type type = ((int)flag) & VM_CHECKMATCH_TYPE_MASK;
@ -2989,7 +2989,7 @@ vm_check_match(VALUE target, VALUE pattern, rb_num_t flag)
for (i = 0; i < n; i++) {
VALUE v = RARRAY_AREF(pattern, i);
VALUE c = check_match(v, target, type);
VALUE c = check_match(ec, v, target, type);
if (RTEST(c)) {
return c;
@ -2998,7 +2998,7 @@ vm_check_match(VALUE target, VALUE pattern, rb_num_t flag)
return Qfalse;
}
else {
return check_match(pattern, target, type);
return check_match(ec, pattern, target, type);
}
}