gawk-diffs
[Top][All Lists]
Advanced

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

[gawk-diffs] [SCM] gawk branch, memory-work, updated. gawk-4.1.0-508-gac


From: Arnold Robbins
Subject: [gawk-diffs] [SCM] gawk branch, memory-work, updated. gawk-4.1.0-508-gac7bcb4
Date: Mon, 17 Nov 2014 15:25:20 +0000

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, memory-work has been updated
       via  ac7bcb4c8cdc07f974205709616fda91a447c0f1 (commit)
      from  624caa19ebb5b5a19046f0b0deb96b2e6c093685 (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=ac7bcb4c8cdc07f974205709616fda91a447c0f1

commit ac7bcb4c8cdc07f974205709616fda91a447c0f1
Author: Arnold D. Robbins <address@hidden>
Date:   Mon Nov 17 17:25:05 2014 +0200

    Add unfield code in several spots.

diff --git a/interpret.h b/interpret.h
index 9910ea7..2901f60 100644
--- a/interpret.h
+++ b/interpret.h
@@ -23,7 +23,19 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, 
USA
  */
 
-
+#define UNFIELD(l, r) \
+{ \
+       /* if was a field, turn it into a var */ \
+       if ((r->flags & FIELD) == 0) { \
+               l = r; \
+       } else if (r->valref == 1) { \
+               r->flags &= ~FIELD; \
+               l = r; \
+       } else { \
+               l = dupnode(r); \
+               DEREF(r); \
+       } \
+}
 int
 r_interpret(INSTRUCTION *code)
 {
@@ -640,7 +652,12 @@ mod:
                        }
 
                        unref(*lhs);
-                       *lhs = POP_SCALAR();
+                       if (do_old_mem) {
+                               *lhs = POP_SCALAR();
+                       } else {
+                               r = POP_SCALAR();
+                               UNFIELD(*lhs, r);
+                       }
 
                        /* execute post-assignment routine if any */
                        if (t1->astore != NULL)
@@ -671,17 +688,7 @@ mod:
                                        *lhs = r;
                                } else {
                                        r = POP_SCALAR();
-
-                                       /* if was a field, turn it into a var */
-                                       if ((r->flags & FIELD) == 0) {
-                                               *lhs = r;
-                                       } else if (r->valref == 1) {
-                                               r->flags &= ~FIELD;
-                                               *lhs = r;
-                                       } else {
-                                               *lhs = dupnode(r);
-                                               DEREF(r);
-                                       }
+                                       UNFIELD(*lhs, r);
                                }
                        }
                        break;
@@ -698,7 +705,12 @@ mod:
                        decr_sp();
                        DEREF(t1);
                        unref(*lhs);
-                       *lhs = POP_SCALAR();
+                       if (do_old_mem) {
+                               *lhs = POP_SCALAR();
+                       } else {
+                               r = POP_SCALAR();
+                               UNFIELD(*lhs, r);
+                       }
                        assert(assign != NULL);
                        assign();
                }
@@ -752,8 +764,13 @@ mod:
                        lhs = POP_ADDRESS();
                        r = TOP_SCALAR();
                        unref(*lhs);
-                       *lhs = r;
-                       UPREF(r);
+                       if (do_old_mem) {
+                               *lhs = r;
+                               UPREF(r);
+                       } else {
+                               UPREF(r);
+                               UNFIELD(*lhs, r);
+                       }
                        REPLACE(r);
                        break;
 

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

Summary of changes:
 interpret.h |   49 +++++++++++++++++++++++++++++++++----------------
 1 files changed, 33 insertions(+), 16 deletions(-)


hooks/post-receive
-- 
gawk



reply via email to

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