[前][次][番号順一覧][スレッド一覧]

ruby-changes:52482

From: shyouhei <ko1@a...>
Date: Wed, 12 Sep 2018 13:04:37 +0900 (JST)
Subject: [ruby-changes:52482] shyouhei:r64691 (trunk): resurrect the string to expect modifications

shyouhei	2018-09-12 13:04:31 +0900 (Wed, 12 Sep 2018)

  New Revision: 64691

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=64691

  Log:
    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.

  Modified files:
    trunk/insns.def
Index: insns.def
===================================================================
--- insns.def	(revision 64690)
+++ insns.def	(revision 64691)
@@ -760,7 +760,7 @@ opt_str_freeze https://github.com/ruby/ruby/blob/trunk/insns.def#L760
     val = vm_opt_str_freeze(str, BOP_FREEZE, idFreeze);
 
     if (val == Qundef) {
-        PUSH(str);
+        PUSH(rb_str_resurrect(str));
 #ifndef MJIT_HEADER
         ADD_PC(-WIDTH_OF_opt_send_without_block);
 #endif
@@ -777,7 +777,7 @@ opt_str_uminus https://github.com/ruby/ruby/blob/trunk/insns.def#L777
     val = vm_opt_str_freeze(str, BOP_UMINUS, idUMinus);
 
     if (val == Qundef) {
-        PUSH(str);
+        PUSH(rb_str_resurrect(str));
 #ifndef MJIT_HEADER
         ADD_PC(-WIDTH_OF_opt_send_without_block);
 #endif

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]