don't allow setting class variable on module that's frozen [Bug #19341]

This commit is contained in:
lukeg 2023-01-14 16:52:29 -05:00 committed by Peter Zhu
parent bf3940a306
commit f66804e6f7
Notes: git 2023-01-19 21:25:41 +00:00
2 changed files with 16 additions and 0 deletions

View file

@ -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();
{