resurrect the string to expect modifications

String#freeze can be redefined to be destructive.  While such
redefinition is definitely weird, it should be possible.  Resurrect
the string to prepare for that sort of things.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
shyouhei 2018-09-12 04:04:31 +00:00
Родитель 02b52b2733
Коммит 0f6708eb9b
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -760,7 +760,7 @@ opt_str_freeze
val = vm_opt_str_freeze(str, BOP_FREEZE, idFreeze); val = vm_opt_str_freeze(str, BOP_FREEZE, idFreeze);
if (val == Qundef) { if (val == Qundef) {
PUSH(str); PUSH(rb_str_resurrect(str));
#ifndef MJIT_HEADER #ifndef MJIT_HEADER
ADD_PC(-WIDTH_OF_opt_send_without_block); ADD_PC(-WIDTH_OF_opt_send_without_block);
#endif #endif
@ -777,7 +777,7 @@ opt_str_uminus
val = vm_opt_str_freeze(str, BOP_UMINUS, idUMinus); val = vm_opt_str_freeze(str, BOP_UMINUS, idUMinus);
if (val == Qundef) { if (val == Qundef) {
PUSH(str); PUSH(rb_str_resurrect(str));
#ifndef MJIT_HEADER #ifndef MJIT_HEADER
ADD_PC(-WIDTH_OF_opt_send_without_block); ADD_PC(-WIDTH_OF_opt_send_without_block);
#endif #endif