summaryrefslogtreecommitdiff
path: root/interpret.h
diff options
context:
space:
mode:
authorAndrew J. Schorr <aschorr@telemetry-investments.com>2017-01-15 12:02:39 -0500
committerAndrew J. Schorr <aschorr@telemetry-investments.com>2017-01-15 12:02:39 -0500
commit2fd82e70b4a9b85427a126f103841ebcb8e8bb16 (patch)
tree3990c28081b33db45b58e4ef423d2aa15fdfef39 /interpret.h
parentb33ef3ff6b2e5704457439d405e39b3b891e3f12 (diff)
downloadgawk-2fd82e70b4a9b85427a126f103841ebcb8e8bb16.tar.gz
Fix bug in string concatenation optimization.
Diffstat (limited to 'interpret.h')
-rw-r--r--interpret.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/interpret.h b/interpret.h
index e9abdffb..90573af4 100644
--- a/interpret.h
+++ b/interpret.h
@@ -706,14 +706,16 @@ mod:
*lhs = dupnode(t1);
}
- if (t1 != t2 && t1->valref == 1 && (t1->flags & MPFN) == 0) {
+ if (t1 != t2 && t1->valref == 1 && (t1->flags & (MPFN|MPZN)) == 0) {
size_t nlen = t1->stlen + t2->stlen;
erealloc(t1->stptr, char *, nlen + 2, "r_interpret");
memcpy(t1->stptr + t1->stlen, t2->stptr, t2->stlen);
t1->stlen = nlen;
t1->stptr[nlen] = '\0';
- t1->flags &= ~(NUMCUR|NUMBER|NUMINT);
+ t1->flags &= ~(NUMCUR|NUMBER|MAYBE_NUM|NUMINT|INTIND);
+ t1->flags |= (STRING|STRCUR);
+ t1->stfmt = -1;
if ((t1->flags & WSTRCUR) != 0 && (t2->flags & WSTRCUR) != 0) {
size_t wlen = t1->wstlen + t2->wstlen;