gawk-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gawk-diffs] [SCM] gawk branch, master, updated. gawk-4.1.0-2403-gf7d895


From: Andrew J. Schorr
Subject: [gawk-diffs] [SCM] gawk branch, master, updated. gawk-4.1.0-2403-gf7d8956
Date: Wed, 18 Jan 2017 15:44:11 +0000 (UTC)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gawk".

The branch, master has been updated
       via  f7d8956c4fd8324667060933c2c30112e6c80507 (commit)
      from  c04fec1b8c96e2b11d451fc45cfd1cf38420310f (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=f7d8956c4fd8324667060933c2c30112e6c80507

commit f7d8956c4fd8324667060933c2c30112e6c80507
Author: Andrew J. Schorr <address@hidden>
Date:   Wed Jan 18 10:43:45 2017 -0500

    Improve robustness of Op_assign_concat optimization.

diff --git a/ChangeLog b/ChangeLog
index ea490ad..3650a30 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2017-01-18         Andrew J. Schorr     <address@hidden>
+
+       * interpret.h (r_interpret): Increase robustness of the optimization
+       logic in Op_assign_concat -- check that the node has MALLOC set,
+       and make sure to wipe all flags other than MALLOC, STRING, STRCUR,
+       and possibly WSTRCUR. Use STFMT_UNUSED define.
+
 2017-01-15         Andrew J. Schorr     <address@hidden>
 
        * interpret.h (r_interpret): Fix bug in Op_assign_concat reported
diff --git a/interpret.h b/interpret.h
index 3526325..9661910 100644
--- a/interpret.h
+++ b/interpret.h
@@ -718,16 +718,18 @@ mod:
                                *lhs = dupnode(t1);
                        }
 
-                       if (t1 != t2 && t1->valref == 1 && (t1->flags & 
(MPFN|MPZN)) == 0) {
+                       if (t1 != t2 && t1->valref == 1 && (t1->flags & 
(MALLOC|MPFN|MPZN)) == MALLOC) {
                                size_t nlen = t1->stlen + t2->stlen;
 
                                erealloc(t1->stptr, char *, nlen + 1, 
"r_interpret");
                                memcpy(t1->stptr + t1->stlen, t2->stptr, 
t2->stlen);
                                t1->stlen = nlen;
                                t1->stptr[nlen] = '\0';
-                               t1->flags &= 
~(NUMCUR|NUMBER|USER_INPUT|NUMINT|INTIND);
-                               t1->flags |= (STRING|STRCUR);
-                               t1->stfmt = -1;
+                               /* clear flags except WSTRCUR (used below) */
+                               t1->flags &= WSTRCUR;
+                               /* configure as a string as in make_str_node */
+                               t1->flags |= (MALLOC|STRING|STRCUR);
+                               t1->stfmt = STFMT_UNUSED;
 
                                if ((t1->flags & WSTRCUR) != 0 && (t2->flags & 
WSTRCUR) != 0) {
                                        size_t wlen = t1->wstlen + t2->wstlen;
@@ -737,7 +739,6 @@ mod:
                                        memcpy(t1->wstptr + t1->wstlen, 
t2->wstptr, t2->wstlen * sizeof(wchar_t));
                                        t1->wstlen = wlen;
                                        t1->wstptr[wlen] = L'\0';
-                                       t1->flags |= WSTRCUR;
                                } else
                                        free_wstr(*lhs);
                        } else {

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog   |    7 +++++++
 interpret.h |   11 ++++++-----
 2 files changed, 13 insertions(+), 5 deletions(-)


hooks/post-receive
-- 
gawk



reply via email to

[Prev in Thread] Current Thread [Next in Thread]