1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42152 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ko1 2013-07-24 09:57:49 +00:00
parent 33ebcb0538
commit d9a556548e
2 changed files with 15 additions and 5 deletions

View file

@ -1,3 +1,12 @@
Wed Jul 24 18:56:06 2013 Koichi Sasada <ko1@atdot.net>
* 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@atdot.net>
* array.c, gc.c: move ary_unprotect_logging() into

View file

@ -784,7 +784,8 @@ vm_expandarray(rb_control_frame_t *cfp, VALUE ary, rb_num_t num, int flag)
{
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, VALUE ary, rb_num_t num, int flag)
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 *th, rb_control_frame_t *cfp, rb_call_inf
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 *th, rb_control_frame_t *cfp, rb_call_inf
}
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 *th, const rb_iseq_t * iseq,
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