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

ruby-changes:50930

From: nobu <ko1@a...>
Date: Thu, 12 Apr 2018 18:35:00 +0900 (JST)
Subject: [ruby-changes:50930] nobu:r63137 (trunk): error.c: fix for DRb

nobu	2018-04-12 18:34:54 +0900 (Thu, 12 Apr 2018)

  New Revision: 63137

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

  Log:
    error.c: fix for DRb
    
    * error.c (name_err_init_attr): hide the receiver object from
      Marshal, as DRb depends on it.

  Modified files:
    trunk/error.c
Index: error.c
===================================================================
--- error.c	(revision 63136)
+++ error.c	(revision 63137)
@@ -888,7 +888,7 @@ static VALUE rb_eNOERROR; https://github.com/ruby/ruby/blob/trunk/error.c#L888
 
 static ID id_cause, id_message, id_backtrace;
 static ID id_name, id_key, id_args, id_Errno, id_errno, id_i_path;
-static ID id_receiver, id_iseq, id_local_variables;
+static ID id_receiver, id_recv, id_iseq, id_local_variables;
 static ID id_private_call_p, id_top, id_bottom;
 #define id_bt idBt
 #define id_bt_locations idBt_locations
@@ -1434,7 +1434,7 @@ name_err_init_attr(VALUE exc, VALUE recv https://github.com/ruby/ruby/blob/trunk/error.c#L1434
     rb_control_frame_t *cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(ec->cfp);
     cfp = rb_vm_get_ruby_level_next_cfp(ec, cfp);
     rb_ivar_set(exc, id_name, method);
-    if (recv != Qundef) rb_ivar_set(exc, id_receiver, recv);
+    if (recv != Qundef) rb_ivar_set(exc, id_recv, recv);
     if (cfp) rb_ivar_set(exc, id_iseq, rb_iseqw_new(cfp->iseq));
     return exc;
 }
@@ -1700,7 +1700,7 @@ name_err_receiver(VALUE self) https://github.com/ruby/ruby/blob/trunk/error.c#L1700
 {
     VALUE *ptr, recv, mesg;
 
-    recv = rb_ivar_lookup(self, id_receiver, Qundef);
+    recv = rb_ivar_lookup(self, id_recv, Qundef);
     if (recv != Qundef) return recv;
 
     mesg = rb_attr_get(self, id_mesg);
@@ -2516,6 +2516,7 @@ Init_Exception(void) https://github.com/ruby/ruby/blob/trunk/error.c#L2516
     id_top = rb_intern_const("top");
     id_bottom = rb_intern_const("bottom");
     id_iseq = rb_make_internal_id();
+    id_recv = rb_make_internal_id();
 }
 
 void

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

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