From ad492eb9f3f217f60fd539bc23cce10ad40a36d1 Mon Sep 17 00:00:00 2001 From: Kouhei Sutou Date: Mon, 11 Jan 2016 00:34:15 +0900 Subject: Fix class variable reference in module Fix #3079 --- src/variable.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/variable.c') diff --git a/src/variable.c b/src/variable.c index bda7b2a98..3b5674923 100644 --- a/src/variable.c +++ b/src/variable.c @@ -773,7 +773,7 @@ mrb_mod_cv_get(mrb_state *mrb, struct RClass * c, mrb_sym sym) klass = mrb_obj_iv_get(mrb, (struct RObject *)cls, mrb_intern_lit(mrb, "__attached__")); c = mrb_class_ptr(klass); - if (c->tt == MRB_TT_CLASS) { + if (c->tt == MRB_TT_CLASS || c->tt == MRB_TT_MODULE) { while (c) { if (c->iv && iv_get(mrb, c->iv, sym, &v)) { return v; -- cgit v1.2.3