diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-10-30 03:21:56 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-10-30 03:21:56 +0000 |
commit | 54726befc3eb52bf06640bfb07664dace3721d14 (patch) | |
tree | 99766412fdcda4ec9e5d901e630475c90b56ec94 /compile.c | |
parent | f7c0cc36920a4ed14a3ab1ca6cfdf18ceff1e5d5 (diff) | |
download | ruby-54726befc3eb52bf06640bfb07664dace3721d14.tar.gz |
use RARRAY_AREF() instead of RARRAY_CONST_PTR().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65438 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'compile.c')
-rw-r--r-- | compile.c | 21 |
1 files changed, 9 insertions, 12 deletions
@@ -7754,7 +7754,6 @@ iseq_build_from_ary_exception(rb_iseq_t *iseq, struct st_table *labels_table, for (i=0; i<RARRAY_LEN(exception); i++) { const rb_iseq_t *eiseq; VALUE v, type; - const VALUE *ptr; LABEL *lstart, *lend, *lcont; unsigned int sp; @@ -7762,19 +7761,18 @@ iseq_build_from_ary_exception(rb_iseq_t *iseq, struct st_table *labels_table, if (RARRAY_LEN(v) != 6) { rb_raise(rb_eSyntaxError, "wrong exception entry"); } - ptr = RARRAY_CONST_PTR(v); - type = get_exception_sym2type(ptr[0]); - if (ptr[1] == Qnil) { + type = get_exception_sym2type(RARRAY_AREF(v, 0)); + if (RARRAY_AREF(v, 1) == Qnil) { eiseq = NULL; } else { - eiseq = rb_iseqw_to_iseq(rb_iseq_load(ptr[1], (VALUE)iseq, Qnil)); - } + eiseq = rb_iseqw_to_iseq(rb_iseq_load(RARRAY_AREF(v, 1), (VALUE)iseq, Qnil)); + } - lstart = register_label(iseq, labels_table, ptr[2]); - lend = register_label(iseq, labels_table, ptr[3]); - lcont = register_label(iseq, labels_table, ptr[4]); - sp = NUM2UINT(ptr[5]); + lstart = register_label(iseq, labels_table, RARRAY_AREF(v, 2)); + lend = register_label(iseq, labels_table, RARRAY_AREF(v, 3)); + lcont = register_label(iseq, labels_table, RARRAY_AREF(v, 4)); + sp = NUM2UINT(RARRAY_AREF(v, 5)); /* TODO: Dirty Hack! Fix me */ if (type == CATCH_TYPE_RESCUE || @@ -7882,7 +7880,6 @@ iseq_build_from_ary_body(rb_iseq_t *iseq, LINK_ANCHOR *const anchor, VALUE body, VALUE labels_wrapper) { /* TODO: body should be frozen */ - const VALUE *ptr = RARRAY_CONST_PTR(body); long i, len = RARRAY_LEN(body); struct st_table *labels_table = DATA_PTR(labels_wrapper); int j; @@ -7899,7 +7896,7 @@ iseq_build_from_ary_body(rb_iseq_t *iseq, LINK_ANCHOR *const anchor, } for (i=0; i<len; i++) { - VALUE obj = ptr[i]; + VALUE obj = RARRAY_AREF(body, i); if (SYMBOL_P(obj)) { rb_event_flag_t event; |