summaryrefslogtreecommitdiff
path: root/variable.c
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2025-02-27 11:07:36 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2025-02-27 11:07:36 +0900
commit931ac960b6d11937364b6c4e847fdd575ee67980 (patch)
tree809fdbd9cad175603a2f8f7770a91afe739389aa /variable.c
parent1b6fddf4db9405d44db8b30493a943d766ddc1cb (diff)
[Bug #21159] module names should not be modifiable
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/12819
Diffstat (limited to 'variable.c')
-rw-r--r--variable.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/variable.c b/variable.c
index cef867c701..2d022d59b1 100644
--- a/variable.c
+++ b/variable.c
@@ -238,6 +238,8 @@ rb_mod_set_temporary_name(VALUE mod, VALUE name)
rb_raise(rb_eArgError, "the temporary name must not be a constant path to avoid confusion");
}
+ name = rb_str_new_frozen(name);
+
// Set the temporary classpath to the given name:
RCLASS_SET_CLASSPATH(mod, name, FALSE);
}