summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--vm.c12
-rw-r--r--vm_eval.c10
2 files changed, 11 insertions, 11 deletions
diff --git a/vm.c b/vm.c
index c89d3a35f3..af5bcb273a 100644
--- a/vm.c
+++ b/vm.c
@@ -516,24 +516,24 @@ vm_make_env_each(rb_thread_t * const th, rb_control_frame_t * const cfp,
}
static int
-collect_local_variables_in_iseq(rb_iseq_t *iseq, const VALUE ary)
+collect_local_variables_in_iseq(rb_iseq_t *iseq, const VALUE vars)
{
int i;
if (!iseq) return 0;
for (i = 0; i < iseq->local_table_size; i++) {
ID lid = iseq->local_table[i];
if (rb_is_local_id(lid)) {
- rb_ary_push(ary, ID2SYM(lid));
+ rb_ary_push(vars, ID2SYM(lid));
}
}
return 1;
}
static int
-collect_local_variables_in_env(rb_env_t * env, const VALUE ary)
+collect_local_variables_in_env(rb_env_t *env, const VALUE vars)
{
- while (collect_local_variables_in_iseq(env->block.iseq, ary),
+ while (collect_local_variables_in_iseq(env->block.iseq, vars),
env->prev_envval) {
GetEnvPtr(env->prev_envval, env);
}
@@ -541,12 +541,12 @@ collect_local_variables_in_env(rb_env_t * env, const VALUE ary)
}
static int
-vm_collect_local_variables_in_heap(rb_thread_t *th, VALUE *ep, VALUE ary)
+vm_collect_local_variables_in_heap(rb_thread_t *th, VALUE *ep, VALUE vars)
{
if (ENV_IN_HEAP_P(th, ep)) {
rb_env_t *env;
GetEnvPtr(ENV_VAL(ep), env);
- collect_local_variables_in_env(env, ary);
+ collect_local_variables_in_env(env, vars);
return 1;
}
else {
diff --git a/vm_eval.c b/vm_eval.c
index 23e0b772b2..f12e5d0886 100644
--- a/vm_eval.c
+++ b/vm_eval.c
@@ -18,7 +18,7 @@ static inline VALUE vm_yield_with_block(rb_thread_t *th, int argc, const VALUE *
static NODE *vm_cref_push(rb_thread_t *th, VALUE klass, int noex, rb_block_t *blockptr);
static VALUE vm_exec(rb_thread_t *th);
static void vm_set_eval_stack(rb_thread_t * th, VALUE iseqval, const NODE *cref, rb_block_t *base_block);
-static int vm_collect_local_variables_in_heap(rb_thread_t *th, VALUE *dfp, VALUE ary);
+static int vm_collect_local_variables_in_heap(rb_thread_t *th, VALUE *dfp, VALUE vars);
/* vm_backtrace.c */
VALUE rb_vm_backtrace_str_ary(rb_thread_t *th, int lev, int n);
@@ -1886,7 +1886,7 @@ rb_catch_protect(VALUE t, rb_block_call_func *func, VALUE data, int *stateptr)
static VALUE
rb_f_local_variables(void)
{
- VALUE ary = rb_ary_new();
+ VALUE vars = rb_ary_new();
rb_thread_t *th = GET_THREAD();
rb_control_frame_t *cfp =
vm_get_ruby_level_caller_cfp(th, RUBY_VM_PREVIOUS_CONTROL_FRAME(th->cfp));
@@ -1900,7 +1900,7 @@ rb_f_local_variables(void)
const char *vname = rb_id2name(lid);
/* should skip temporary variable */
if (vname) {
- rb_ary_push(ary, ID2SYM(lid));
+ rb_ary_push(vars, ID2SYM(lid));
}
}
}
@@ -1909,7 +1909,7 @@ rb_f_local_variables(void)
/* block */
VALUE *ep = VM_CF_PREV_EP(cfp);
- if (vm_collect_local_variables_in_heap(th, ep, ary)) {
+ if (vm_collect_local_variables_in_heap(th, ep, vars)) {
break;
}
else {
@@ -1922,7 +1922,7 @@ rb_f_local_variables(void)
break;
}
}
- return ary;
+ return vars;
}
/*