summaryrefslogtreecommitdiffhomepage
path: root/src/codedump.c
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2020-11-05 16:55:23 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2020-11-05 16:55:23 +0900
commitf77113e8416cc66270e5d6f7c171c8715708e31c (patch)
treeeff88a8fa1d9aa8fe5ae480d3d8669dd951ec160 /src/codedump.c
parentd9bd77b180a6f9832d5a016af0be29e3399bd8b1 (diff)
downloadmruby-f77113e8416cc66270e5d6f7c171c8715708e31c.tar.gz
mruby-f77113e8416cc66270e5d6f7c171c8715708e31c.zip
Fix a bug with printing `(null)` local variable name for a register.
Diffstat (limited to 'src/codedump.c')
-rw-r--r--src/codedump.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/codedump.c b/src/codedump.c
index b62342c15..5acc274c3 100644
--- a/src/codedump.c
+++ b/src/codedump.c
@@ -11,7 +11,7 @@ static void
print_r(mrb_state *mrb, const mrb_irep *irep, size_t n)
{
if (n == 0) return;
- if (n > irep->nlocals) 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]));
}