summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-proc-ext/src/proc.c
diff options
context:
space:
mode:
authortake_cheeze <[email protected]>2014-04-29 22:06:59 +0900
committertake_cheeze <[email protected]>2014-04-29 22:06:59 +0900
commit5073d14e280a82e4cb4e41692154de825b07b5e9 (patch)
tree6a120379e31fae527a10f2267bff9834020b6d2f /mrbgems/mruby-proc-ext/src/proc.c
parent7ea82fedd5585bc753464aae7fc406cd2f1ce08e (diff)
downloadmruby-5073d14e280a82e4cb4e41692154de825b07b5e9.tar.gz
mruby-5073d14e280a82e4cb4e41692154de825b07b5e9.zip
Remove `lv_len` and use `nlocals - 1` instead.
Check that `lv`'s length is always `nlocals - 1`.
Diffstat (limited to 'mrbgems/mruby-proc-ext/src/proc.c')
-rw-r--r--mrbgems/mruby-proc-ext/src/proc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/mrbgems/mruby-proc-ext/src/proc.c b/mrbgems/mruby-proc-ext/src/proc.c
index 964a7c9bb..341001f05 100644
--- a/mrbgems/mruby-proc-ext/src/proc.c
+++ b/mrbgems/mruby-proc-ext/src/proc.c
@@ -137,8 +137,8 @@ mrb_local_variables(mrb_state *mrb, mrb_value self)
}
irep = proc->body.irep;
- ret = mrb_ary_new_capa(mrb, irep->lv_len);
- for (i = 0; i < irep->lv_len; ++i) {
+ ret = mrb_ary_new_capa(mrb, irep->nlocals - 1);
+ for (i = 0; i < (irep->nlocals - 1); ++i) {
mrb_ary_push(mrb, ret, mrb_symbol_value(irep->lv[i].name));
}