From b3fa425feb23dd36e82d4dd71f0bc1e03495a46b Mon Sep 17 00:00:00 2001 From: "Andrew J. Schorr" Date: Mon, 4 Jul 2016 10:34:00 -0400 Subject: It is OK to use a strnum as a string array subscript, since we now respect the string value. --- str_array.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'str_array.c') diff --git a/str_array.c b/str_array.c index f66b22cc..e8ce973e 100644 --- a/str_array.c +++ b/str_array.c @@ -164,11 +164,9 @@ str_lookup(NODE *symbol, NODE *subs) * "Array indices are always strings." * "Array indices are always strings." * .... - * If subs is a STRNUM, copy it; don't clear the MAYBE_NUM - * flag on it since other variables could be using the same - * reference-counted value. */ - if (subs->stfmt != STFMT_UNUSED || (subs->flags & MAYBE_NUM) != 0) { + if (subs->stfmt != STFMT_UNUSED) { + /* The string was generated using CONVFMT. */ NODE *tmp; /* @@ -199,8 +197,6 @@ str_lookup(NODE *symbol, NODE *subs) subs = dupnode(subs); } - assert((subs->flags & MAYBE_NUM) == 0); - getbucket(b); b->ahnext = symbol->buckets[hash1]; symbol->buckets[hash1] = b; -- cgit v1.2.3