diff options
author | lukeg <[email protected]> | 2023-01-14 16:52:29 -0500 |
---|---|---|
committer | Peter Zhu <[email protected]> | 2023-01-19 16:25:20 -0500 |
commit | f66804e6f78ed4cf81896d2256743a820b05939a (patch) | |
tree | a7c981dcb2b9cf7b4f03ba471d26afa9c5c43a4f /variable.c | |
parent | bf3940a306c5292324caa0b4756b90411cc3cdf1 (diff) |
don't allow setting class variable on module that's frozen [Bug #19341]
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/7124
Diffstat (limited to 'variable.c')
-rw-r--r-- | variable.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/variable.c b/variable.c index f297900cf0..f1d89ab615 100644 --- a/variable.c +++ b/variable.c @@ -3939,6 +3939,7 @@ rb_class_ivar_set(VALUE obj, ID key, VALUE value) { RUBY_ASSERT(RB_TYPE_P(obj, T_CLASS) || RB_TYPE_P(obj, T_MODULE)); int found; + rb_check_frozen(obj); RB_VM_LOCK_ENTER(); { |