summaryrefslogtreecommitdiff
path: root/vm_insnhelper.c
diff options
context:
space:
mode:
Diffstat (limited to 'vm_insnhelper.c')
-rw-r--r--vm_insnhelper.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/vm_insnhelper.c b/vm_insnhelper.c
index a5c194e0ee..36d877bbdd 100644
--- a/vm_insnhelper.c
+++ b/vm_insnhelper.c
@@ -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