gawk-diffs
[Top][All Lists]
Advanced

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

[gawk-diffs] [SCM] gawk branch, gawk-4.1-stable, updated. gawk-4.1.0-679


From: Arnold Robbins
Subject: [gawk-diffs] [SCM] gawk branch, gawk-4.1-stable, updated. gawk-4.1.0-679-gf088a3e
Date: Tue, 28 Apr 2015 13:40:42 +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, gawk-4.1-stable has been updated
       via  f088a3efc8aefc47f0bfe7824732aae4283b4c15 (commit)
      from  7bda05c66848de97a7b43aa3e37ff4336f1b3220 (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=f088a3efc8aefc47f0bfe7824732aae4283b4c15

commit f088a3efc8aefc47f0bfe7824732aae4283b4c15
Author: Arnold D. Robbins <address@hidden>
Date:   Tue Apr 28 16:39:13 2015 +0300

    Make call-by-value work again for $0.

diff --git a/ChangeLog b/ChangeLog
index 3e9764a..448bdca 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,13 @@
        * awkgram.y (yylex): Rework the bracket handling from zero.
        Thanks to Michal Jaegermann for yet another test case.
 
+       Unrelated:
+
+       * eval.c (setup_frame): Restore call-by-value for $0. This was
+       necessitated by the changes on 2014-11-11 for conserving
+       memory use. Thanks to Andrew Schorr for the report and isolating
+       the cause of the problem.
+
 2015-04-27         Arnold D. Robbins     <address@hidden>
 
        * awkgram.y (yylex): Make change of Jan 7 for parsing regexps
diff --git a/eval.c b/eval.c
index 1277684..dfb99a4 100644
--- a/eval.c
+++ b/eval.c
@@ -1325,7 +1325,13 @@ setup_frame(INSTRUCTION *pc)
 
                if (m->type == Node_param_list)
                        m = GET_PARAM(m->param_cnt);
-                       
+
+               /* $0 needs to be passed by value to a function */
+               if (m == fields_arr[0]) {
+                       DEREF(m);
+                       m = dupnode(m);
+               }
+
                switch (m->type) {
                case Node_var_new:
                case Node_var_array:
diff --git a/test/ChangeLog b/test/ChangeLog
index cde85f8..437760e 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,8 @@
+2015-04-27         Andrew J. Schorr     <address@hidden>
+
+       * Makefile.am (inpref): New test.
+       * inpref.awk, inpref.in, inpref.ok: New files.
+
 2015-04-27         Arnold D. Robbins     <address@hidden>
 
        * Makefile.am (regexpbrack2): New test.
diff --git a/test/Makefile.am b/test/Makefile.am
index bf1d073..edad8bb 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -406,6 +406,9 @@ EXTRA_DIST = \
        icasers.awk \
        icasers.in \
        icasers.ok \
+       inpref.awk \
+       inpref.in \
+       inpref.ok \
        id.awk \
        id.ok \
        igncdym.awk \
@@ -1018,7 +1021,7 @@ BASIC_TESTS = \
        gsubasgn gsubtest gsubtst2 gsubtst3 gsubtst4 gsubtst5 gsubtst6 \
        gsubtst7 gsubtst8 \
        hex hsprint \
-       inputred intest intprec iobug1 \
+       inpref inputred intest intprec iobug1 \
        leaddig leadnl litoct longsub longwrds \
        manglprm math membug1 messages minusstr mmap8k mtchi18n \
        nasty nasty2 negexp negrange nested nfldstr nfloop nfneg nfset nlfldsep 
\
diff --git a/test/Makefile.in b/test/Makefile.in
index 0cd1060..b549226 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -663,6 +663,9 @@ EXTRA_DIST = \
        icasers.awk \
        icasers.in \
        icasers.ok \
+       inpref.awk \
+       inpref.in \
+       inpref.ok \
        id.awk \
        id.ok \
        igncdym.awk \
@@ -1274,7 +1277,7 @@ BASIC_TESTS = \
        gsubasgn gsubtest gsubtst2 gsubtst3 gsubtst4 gsubtst5 gsubtst6 \
        gsubtst7 gsubtst8 \
        hex hsprint \
-       inputred intest intprec iobug1 \
+       inpref inputred intest intprec iobug1 \
        leaddig leadnl litoct longsub longwrds \
        manglprm math membug1 messages minusstr mmap8k mtchi18n \
        nasty nasty2 negexp negrange nested nfldstr nfloop nfneg nfset nlfldsep 
\
@@ -2908,6 +2911,11 @@ hsprint:
        @AWKPATH="$(srcdir)" $(AWK) -f address@hidden  >_$@ 2>&1 || echo EXIT 
CODE: $$? >>_$@
        @-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
 
+inpref:
+       @echo $@
+       @AWKPATH="$(srcdir)" $(AWK) -f address@hidden  < 
"$(srcdir)"/address@hidden >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+       @-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
+
 inputred:
        @echo $@
        @AWKPATH="$(srcdir)" $(AWK) -f address@hidden  >_$@ 2>&1 || echo EXIT 
CODE: $$? >>_$@
diff --git a/test/Maketests b/test/Maketests
index e9c8985..95d9e80 100644
--- a/test/Maketests
+++ b/test/Maketests
@@ -405,6 +405,11 @@ hsprint:
        @AWKPATH="$(srcdir)" $(AWK) -f address@hidden  >_$@ 2>&1 || echo EXIT 
CODE: $$? >>_$@
        @-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
 
+inpref:
+       @echo $@
+       @AWKPATH="$(srcdir)" $(AWK) -f address@hidden  < 
"$(srcdir)"/address@hidden >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+       @-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
+
 inputred:
        @echo $@
        @AWKPATH="$(srcdir)" $(AWK) -f address@hidden  >_$@ 2>&1 || echo EXIT 
CODE: $$? >>_$@
diff --git a/test/inpref.awk b/test/inpref.awk
new file mode 100644
index 0000000..d64ffe7
--- /dev/null
+++ b/test/inpref.awk
@@ -0,0 +1,9 @@
+function test(x) {
+       print x
+       getline
+       print x
+}
+
+{
+       test($0)
+}
diff --git a/test/inpref.in b/test/inpref.in
new file mode 100644
index 0000000..a32119c
--- /dev/null
+++ b/test/inpref.in
@@ -0,0 +1,2 @@
+hello
+goodbye
diff --git a/test/inpref.ok b/test/inpref.ok
new file mode 100644
index 0000000..317e967
--- /dev/null
+++ b/test/inpref.ok
@@ -0,0 +1,2 @@
+hello
+hello

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

Summary of changes:
 ChangeLog        |    7 +++++++
 eval.c           |    8 +++++++-
 test/ChangeLog   |    5 +++++
 test/Makefile.am |    5 ++++-
 test/Makefile.in |   10 +++++++++-
 test/Maketests   |    5 +++++
 test/inpref.awk  |    9 +++++++++
 test/inpref.in   |    2 ++
 test/inpref.ok   |    2 ++
 9 files changed, 50 insertions(+), 3 deletions(-)
 create mode 100644 test/inpref.awk
 create mode 100644 test/inpref.in
 create mode 100644 test/inpref.ok


hooks/post-receive
-- 
gawk



reply via email to

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