diff --git a/debug.c b/debug.c index 28211ab3..950337f2 100644 --- a/debug.c +++ b/debug.c @@ -1145,7 +1145,12 @@ print_array(volatile NODE *arr, char *arr_name) subs = list[i]; r = *assoc_lookup((NODE *) arr, subs); if (r->type == Node_var_array) { - ret = print_array(r, r->vname); + // 12/2023: FIXME: a subarray could have been created via + // split() or some other mechanism where flags has NUMINT in it. + // In this case, r->vname can be NULL, so pass in the + // subscript itself. This should be fixed in the code that + // builds such arrays. + ret = print_array(r, r->vname ? r->vname : subs->stptr); } else { print_array_names(names, cur_name, out_fp); gprintf(out_fp, "[\"%.*s\"] = ", (int) subs->stlen, subs->stptr);