aboutsummaryrefslogtreecommitdiffstats
path: root/variable.c
diff options
context:
space:
mode:
Diffstat (limited to 'variable.c')
-rw-r--r--variable.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/variable.c b/variable.c
index ebf23fab67..0d8a424438 100644
--- a/variable.c
+++ b/variable.c
@@ -3143,6 +3143,9 @@ rb_cvar_set(VALUE klass, ID id, VALUE val)
target = tmp;
}
+ if (RB_TYPE_P(target, T_ICLASS)) {
+ target = RBASIC(target)->klass;
+ }
check_before_mod_set(target, id, val, "class variable");
if (!RCLASS_IV_TBL(target)) {
RCLASS_IV_TBL(target) = st_init_numtable();