summaryrefslogtreecommitdiff
path: root/compile.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-05-13 09:56:22 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-05-13 09:56:22 +0000
commitaacd7710462142df7397618ffff4279e495f10f9 (patch)
tree6611fdbf0f66b471386ad19d7854275c583b8914 /compile.c
parent12bf73637b960cf0ef463f966554595ff2c37ecd (diff)
* *.c, parse.y, insns.def: use RARRAY_AREF/ASET macro
instead of using RARRAY_PTR(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40690 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/compile.c b/compile.c
index c9b59b275b..1a911f1f4d 100644
--- a/compile.c
+++ b/compile.c
@@ -223,7 +223,7 @@ r_value(VALUE value)
do { \
if ((event) == RUBY_EVENT_LINE && iseq->coverage && \
(line) != iseq->compile_data->last_coverable_line) { \
- RARRAY_PTR(iseq->coverage)[(line) - 1] = INT2FIX(0); \
+ RARRAY_ASET(iseq->coverage, (line) - 1, INT2FIX(0)); \
iseq->compile_data->last_coverable_line = (line); \
ADD_INSN1((seq), (line), trace, INT2FIX(RUBY_EVENT_COVERAGE)); \
} \
@@ -1209,7 +1209,7 @@ iseq_set_arguments(rb_iseq_t *iseq, LINK_ANCHOR *optargs, NODE *node_args)
keywords = required;
}
for (j = 0; j < i; j++) {
- iseq->arg_keyword_table[j] = FIX2INT(RARRAY_PTR(keywords)[j]);
+ iseq->arg_keyword_table[j] = FIX2INT(RARRAY_AREF(keywords, j));
}
ADD_INSN(optargs, nd_line(args->kw_args), pop);
}
@@ -5571,7 +5571,7 @@ iseq_build_from_ary_exception(rb_iseq_t *iseq, struct st_table *labels_table,
LABEL *lstart, *lend, *lcont;
int sp;
- RB_GC_GUARD(v) = rb_convert_type(RARRAY_PTR(exception)[i], T_ARRAY,
+ RB_GC_GUARD(v) = rb_convert_type(RARRAY_AREF(exception, i), T_ARRAY,
"Array", "to_ary");
if (RARRAY_LEN(v) != 6) {
rb_raise(rb_eSyntaxError, "wrong exception entry");
@@ -5663,7 +5663,7 @@ iseq_build_from_ary_body(rb_iseq_t *iseq, LINK_ANCHOR *anchor,
st_data_t insn_id;
VALUE insn;
- insn = (argc < 0) ? Qnil : RARRAY_PTR(obj)[0];
+ insn = (argc < 0) ? Qnil : RARRAY_AREF(obj, 0);
if (st_lookup(insn_table, (st_data_t)insn, &insn_id) == 0) {
/* TODO: exception */
RB_GC_GUARD(insn) = rb_inspect(insn);
@@ -5794,7 +5794,7 @@ rb_iseq_build_from_ary(rb_iseq_t *iseq, VALUE locals, VALUE args,
iseq->local_size = iseq->local_table_size + 1;
for (i=0; i<RARRAY_LEN(locals); i++) {
- VALUE lv = RARRAY_PTR(locals)[i];
+ VALUE lv = RARRAY_AREF(locals, i);
tbl[i] = FIXNUM_P(lv) ? (ID)FIX2LONG(lv) : SYM2ID(CHECK_SYMBOL(lv));
}