mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
vm_get_ev_const() accepts ec
instead of th
.
* vm_insnhelper.c (vm_get_ev_const): accepts `ec` instead of `th`. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60470 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
06fba0f4d7
commit
b5101cbb23
2 changed files with 6 additions and 6 deletions
|
@ -230,7 +230,7 @@ getconstant
|
||||||
(VALUE klass)
|
(VALUE klass)
|
||||||
(VALUE val)
|
(VALUE val)
|
||||||
{
|
{
|
||||||
val = vm_get_ev_const(th, klass, id, 0);
|
val = vm_get_ev_const(th->ec, klass, id, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -808,14 +808,14 @@ vm_get_iclass(rb_control_frame_t *cfp, VALUE klass)
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline VALUE
|
static inline VALUE
|
||||||
vm_get_ev_const(rb_thread_t *th, VALUE orig_klass, ID id, int is_defined)
|
vm_get_ev_const(rb_execution_context_t *ec, VALUE orig_klass, ID id, int is_defined)
|
||||||
{
|
{
|
||||||
void rb_const_warn_if_deprecated(const rb_const_entry_t *ce, VALUE klass, ID id);
|
void rb_const_warn_if_deprecated(const rb_const_entry_t *ce, VALUE klass, ID id);
|
||||||
VALUE val;
|
VALUE val;
|
||||||
|
|
||||||
if (orig_klass == Qnil) {
|
if (orig_klass == Qnil) {
|
||||||
/* in current lexical scope */
|
/* in current lexical scope */
|
||||||
const rb_cref_t *root_cref = rb_vm_get_cref(th->ec->cfp->ep);
|
const rb_cref_t *root_cref = rb_vm_get_cref(ec->cfp->ep);
|
||||||
const rb_cref_t *cref;
|
const rb_cref_t *cref;
|
||||||
VALUE klass = Qnil;
|
VALUE klass = Qnil;
|
||||||
|
|
||||||
|
@ -861,10 +861,10 @@ vm_get_ev_const(rb_thread_t *th, VALUE orig_klass, ID id, int is_defined)
|
||||||
|
|
||||||
/* search self */
|
/* search self */
|
||||||
if (root_cref && !NIL_P(CREF_CLASS(root_cref))) {
|
if (root_cref && !NIL_P(CREF_CLASS(root_cref))) {
|
||||||
klass = vm_get_iclass(th->ec->cfp, CREF_CLASS(root_cref));
|
klass = vm_get_iclass(ec->cfp, CREF_CLASS(root_cref));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
klass = CLASS_OF(th->ec->cfp->self);
|
klass = CLASS_OF(ec->cfp->self);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_defined) {
|
if (is_defined) {
|
||||||
|
@ -2849,7 +2849,7 @@ vm_defined(rb_thread_t *th, rb_control_frame_t *reg_cfp, rb_num_t op_type, VALUE
|
||||||
}
|
}
|
||||||
case DEFINED_CONST:
|
case DEFINED_CONST:
|
||||||
klass = v;
|
klass = v;
|
||||||
if (vm_get_ev_const(th, klass, SYM2ID(obj), 1)) {
|
if (vm_get_ev_const(th->ec, klass, SYM2ID(obj), 1)) {
|
||||||
expr_type = DEFINED_CONST;
|
expr_type = DEFINED_CONST;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue