mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
codedump.c: avoid printing 'local variable names:' header.
If there is no local variable defined in `irep`.
This commit is contained in:
+6
-3
@@ -100,14 +100,17 @@ codedump(mrb_state *mrb, const mrb_irep *irep)
|
||||
|
||||
if (irep->lv) {
|
||||
int i;
|
||||
int head = FALSE;
|
||||
|
||||
printf("local variable names:\n");
|
||||
for (i = 1; i < irep->nlocals; ++i) {
|
||||
char const *s = mrb_sym_dump(mrb, irep->lv[i - 1]);
|
||||
if (s) {
|
||||
printf(" R%d:%s", i, s);
|
||||
if (!head) {
|
||||
head = TRUE;
|
||||
printf("local variable names:\n");
|
||||
}
|
||||
printf(" R%d:%s\n", i, s);
|
||||
}
|
||||
putchar('\n');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user