mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Merge pull request #4781 from shuujii/fix-that-Module-to_s-may-return-frozen-string
Fix that `Module#to_s` may return frozen string; ref 08eafe2
This commit is contained in:
+2
-1
@@ -1885,7 +1885,8 @@ mrb_mod_to_s(mrb_state *mrb, mrb_value klass)
|
||||
return mrb_str_cat_lit(mrb, str, ">");
|
||||
}
|
||||
else {
|
||||
return class_name_str(mrb, mrb_class_ptr(klass));
|
||||
mrb_value str = class_name_str(mrb, mrb_class_ptr(klass));
|
||||
return mrb_frozen_p(mrb_basic_ptr(str)) ? mrb_str_dup(mrb, str) : str;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user