Commit 52ba6f5a authored by Yukihiro Matsumoto's avatar Yukihiro Matsumoto

class variable resolution should be same as const resolution

parent 722c53c5
...@@ -233,8 +233,9 @@ mrb_obj_instance_variables(mrb_state *mrb, mrb_value self) ...@@ -233,8 +233,9 @@ mrb_obj_instance_variables(mrb_state *mrb, mrb_value self)
mrb_value mrb_value
mrb_vm_cv_get(mrb_state *mrb, mrb_sym sym) mrb_vm_cv_get(mrb_state *mrb, mrb_sym sym)
{ {
struct RClass *c = mrb->ci->target_class; struct RClass *c = mrb->ci->proc->target_class;
if (!c) c = mrb->ci->target_class;
while (c) { while (c) {
if (c->iv) { if (c->iv) {
khash_t(iv) *h = c->iv; khash_t(iv) *h = c->iv;
...@@ -251,10 +252,11 @@ mrb_vm_cv_get(mrb_state *mrb, mrb_sym sym) ...@@ -251,10 +252,11 @@ mrb_vm_cv_get(mrb_state *mrb, mrb_sym sym)
void void
mrb_vm_cv_set(mrb_state *mrb, mrb_sym sym, mrb_value v) mrb_vm_cv_set(mrb_state *mrb, mrb_sym sym, mrb_value v)
{ {
struct RClass *c = mrb->ci->target_class; struct RClass *c = mrb->ci->proc->target_class;
khash_t(iv) *h; khash_t(iv) *h;
khiter_t k; khiter_t k;
if (!c) c = mrb->ci->target_class;
while (c) { while (c) {
if (c->iv) { if (c->iv) {
h = c->iv; h = c->iv;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment