diff options
author | Andrew J. Schorr <aschorr@telemetry-investments.com> | 2016-07-04 10:34:00 -0400 |
---|---|---|
committer | Andrew J. Schorr <aschorr@telemetry-investments.com> | 2016-07-04 10:34:00 -0400 |
commit | b3fa425feb23dd36e82d4dd71f0bc1e03495a46b (patch) | |
tree | 4eb0da682865bc7ca8c01c239e5056442de3ac62 /str_array.c | |
parent | ff4e0706c5ee5dffd69168ebd0ff5f53e474d048 (diff) | |
download | gawk-b3fa425feb23dd36e82d4dd71f0bc1e03495a46b.tar.gz |
It is OK to use a strnum as a string array subscript, since we now respect the string value.
Diffstat (limited to 'str_array.c')
-rw-r--r-- | str_array.c | 8 |
1 files changed, 2 insertions, 6 deletions
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; |