ruby-changes:30100
From: ko1 <ko1@a...>
Date: Wed, 24 Jul 2013 18:58:03 +0900 (JST)
Subject: [ruby-changes:30100] ko1:r42152 (trunk): * vm_insnhelper.c (vm_expandarray): use RARRAY_RAWPTR() instead of
ko1 2013-07-24 18:57:49 +0900 (Wed, 24 Jul 2013) New Revision: 42152 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=42152 Log: * vm_insnhelper.c (vm_expandarray): use RARRAY_RAWPTR() instead of RARRAY_PTR() because there is no new reference. * vm_insnhelper.c (vm_caller_setup_args): ditto. * vm_insnhelper.c (vm_yield_setup_block_args): ditto. Modified files: trunk/ChangeLog trunk/vm_insnhelper.c Index: ChangeLog =================================================================== --- ChangeLog (revision 42151) +++ ChangeLog (revision 42152) @@ -1,3 +1,12 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Wed Jul 24 18:56:06 2013 Koichi Sasada <ko1@a...> + + * vm_insnhelper.c (vm_expandarray): use RARRAY_RAWPTR() instead of + RARRAY_PTR() because there is no new reference. + + * vm_insnhelper.c (vm_caller_setup_args): ditto. + + * vm_insnhelper.c (vm_yield_setup_block_args): ditto. + Wed Jul 24 18:40:11 2013 Koichi Sasada <ko1@a...> * array.c, gc.c: move ary_unprotect_logging() into Index: vm_insnhelper.c =================================================================== --- vm_insnhelper.c (revision 42151) +++ vm_insnhelper.c (revision 42152) @@ -784,7 +784,8 @@ vm_expandarray(rb_control_frame_t *cfp, https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L784 { int is_splat = flag & 0x01; rb_num_t space_size = num + is_splat; - VALUE *base = cfp->sp, *ptr; + VALUE *base = cfp->sp; + const VALUE *ptr; rb_num_t len; if (!RB_TYPE_P(ary, T_ARRAY)) { @@ -793,7 +794,7 @@ vm_expandarray(rb_control_frame_t *cfp, https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L794 cfp->sp += space_size; - ptr = RARRAY_PTR(ary); + ptr = RARRAY_RAWPTR(ary); len = (rb_num_t)RARRAY_LEN(ary); if (flag & 0x02) { @@ -1042,7 +1043,7 @@ vm_caller_setup_args(const rb_thread_t * https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L1043 if (UNLIKELY(ci->flag & VM_CALL_ARGS_SPLAT)) { VALUE ary = *(cfp->sp - 1); - VALUE *ptr; + const VALUE *ptr; int i; VALUE tmp; @@ -1053,7 +1054,7 @@ vm_caller_setup_args(const rb_thread_t * https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L1054 } else { long len = RARRAY_LEN(tmp); - ptr = RARRAY_PTR(tmp); + ptr = RARRAY_RAWPTR(tmp); cfp->sp -= 1; CHECK_VM_STACK_OVERFLOW(cfp, len); @@ -2201,7 +2202,7 @@ vm_yield_setup_block_args(rb_thread_t *t https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L2202 CHECK_VM_STACK_OVERFLOW(th->cfp, argc); - MEMCPY(argv, RARRAY_PTR(ary), VALUE, argc); + MEMCPY(argv, RARRAY_RAWPTR(ary), VALUE, argc); } else { /* vm_push_frame current argv is at the top of sp because vm_invoke_block -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/