From ff0e3bcea6fd7d34d4fc6f3f78ef3e4120825401 Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Wed, 22 Jul 2020 14:20:08 +0900 Subject: Check `lv` before printing local variable names. --- src/codedump.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/codedump.c') 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])); } -- cgit v1.2.3