summaryrefslogtreecommitdiffhomepage
path: root/src/variable.c
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2016-01-11 10:00:34 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2016-01-11 10:00:34 +0900
commit814328595608a6eb6a2d1b7578d3151d47f9be79 (patch)
treeeb151545f86c5c33a5a7b7a3e930cab52515fd4e /src/variable.c
parentfb2e0b721fdcf5a65b907ee69ad8e09763632db2 (diff)
parentad492eb9f3f217f60fd539bc23cce10ad40a36d1 (diff)
downloadmruby-814328595608a6eb6a2d1b7578d3151d47f9be79.tar.gz
mruby-814328595608a6eb6a2d1b7578d3151d47f9be79.zip
Merge pull request #3080 from kou/fix-class-variable-in-module
Fix class variable reference in module
Diffstat (limited to 'src/variable.c')
-rw-r--r--src/variable.c2
1 files changed, 1 insertions, 1 deletions
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;