From c51a97fc72b732d19dbc83a7a4aadf9893a92b78 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Wed, 9 Aug 2017 21:01:19 +0300 Subject: Fix array indexing from unassigned var to not keep that attribute. --- str_array.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'str_array.c') diff --git a/str_array.c b/str_array.c index 55e90497..8d6d2b01 100644 --- a/str_array.c +++ b/str_array.c @@ -165,8 +165,13 @@ str_lookup(NODE *symbol, NODE *subs) * "Array indices are always strings." * .... */ - if (subs->stfmt != STFMT_UNUSED) { - /* The string was generated using CONVFMT. */ + // Special cases: + // 1. The string was generated using CONVFMT. + // 2. The string was from an unassigned variable. + // 3. The string was from an unassigned field. + if ( subs->stfmt != STFMT_UNUSED + || subs == Nnull_string + || (subs->flags & NULL_FIELD) != 0) { NODE *tmp; /* -- cgit v1.2.3