summaryrefslogtreecommitdiffhomepage
path: root/src/codedump.c
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2020-07-22 14:20:08 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2020-10-12 16:21:24 +0900
commitff0e3bcea6fd7d34d4fc6f3f78ef3e4120825401 (patch)
tree6ee3cc5f4d898cfbb2691456fd271134955b9a2b /src/codedump.c
parent8b3f3c0bf3551c4808ce2e9ab58fcca480e0ab9c (diff)
downloadmruby-ff0e3bcea6fd7d34d4fc6f3f78ef3e4120825401.tar.gz
mruby-ff0e3bcea6fd7d34d4fc6f3f78ef3e4120825401.zip
Check `lv` before printing local variable names.
Diffstat (limited to 'src/codedump.c')
-rw-r--r--src/codedump.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/codedump.c b/src/codedump.c
index 24fc94ef7..106312f67 100644
--- a/src/codedump.c
+++ b/src/codedump.c
@@ -11,6 +11,7 @@ print_r(mrb_state *mrb, const mrb_irep *irep, size_t n)
{
if (n == 0) return;
if (n > irep->nlocals) return;
+ if (!irep->lv[n-1]) return;
printf(" R%d:%s", (int)n, mrb_sym_dump(mrb, irep->lv[n-1]));
}