[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-996
From: |
Andrew J. Schorr |
Subject: |
[gawk-diffs] [SCM] gawk branch, gawk-4.1-stable, updated. gawk-4.1.0-996-g2fd82e7 |
Date: |
Sun, 15 Jan 2017 17:02:54 +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, gawk-4.1-stable has been updated
via 2fd82e70b4a9b85427a126f103841ebcb8e8bb16 (commit)
from b33ef3ff6b2e5704457439d405e39b3b891e3f12 (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=2fd82e70b4a9b85427a126f103841ebcb8e8bb16
commit 2fd82e70b4a9b85427a126f103841ebcb8e8bb16
Author: Andrew J. Schorr <address@hidden>
Date: Sun Jan 15 12:02:39 2017 -0500
Fix bug in string concatenation optimization.
diff --git a/ChangeLog b/ChangeLog
index 7d3b0f0..3ce1ffe 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2017-01-15 Andrew J. Schorr <address@hidden>
+
+ * interpret.h (r_interpret): Fix bug in Op_assign_concat reported
+ on Cygwin mailing list. The string concatenation optimization was
+ not updating the node correctly by setting STRING and STRCUR flags
+ and setting stfmt.
+
2016-11-04 Eli Zaretskii <address@hidden>
* builtin.c (efwrite) [__MINGW32__]: Call w32_maybe_set_errno if
diff --git a/interpret.h b/interpret.h
index e9abdff..90573af 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;
diff --git a/test/ChangeLog b/test/ChangeLog
index 3a5a661..d07a062 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,9 @@
+2017-01-15 Andrew J. Schorr <address@hidden>
+
+ * Makefile.am (concat5): New test.
+ * concat5.awk, concat5.ok: New files.
+ Check for bug forwarded by Corinna Vinschen from Cygwin mailing list.
+
2016-11-21 Arnold D. Robbins <address@hidden>
* Makefile.am (EXTRA_DIST): Add valgrind.awk to the list.
diff --git a/test/Makefile.am b/test/Makefile.am
index 2209949..f63c02a 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -182,6 +182,8 @@ EXTRA_DIST = \
concat4.awk \
concat4.in \
concat4.ok \
+ concat5.awk \
+ concat5.ok \
convfmt.awk \
convfmt.ok \
crlf.awk \
@@ -1072,7 +1074,7 @@ BASIC_TESTS = \
aryprm8 aryprm9 arysubnm asgext awkpath \
back89 backgsub badassign1 badbuild \
callparam childin clobber closebad clsflnam compare compare2 concat1
concat2 \
- concat3 concat4 convfmt \
+ concat3 concat4 concat5 convfmt \
datanonl defref delargv delarpm2 delarprm delfunc dfamb1 dfastress
dynlj \
eofsplit exit2 exitval1 exitval2 exitval3 \
fcall_exit fcall_exit2 fldchg fldchgnf fnamedat fnarray fnarray2 \
diff --git a/test/Makefile.in b/test/Makefile.in
index 30ddfbc..2fad102 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -439,6 +439,8 @@ EXTRA_DIST = \
concat4.awk \
concat4.in \
concat4.ok \
+ concat5.awk \
+ concat5.ok \
convfmt.awk \
convfmt.ok \
crlf.awk \
@@ -1328,7 +1330,7 @@ BASIC_TESTS = \
aryprm8 aryprm9 arysubnm asgext awkpath \
back89 backgsub badassign1 badbuild \
callparam childin clobber closebad clsflnam compare compare2 concat1
concat2 \
- concat3 concat4 convfmt \
+ concat3 concat4 concat5 convfmt \
datanonl defref delargv delarpm2 delarprm delfunc dfamb1 dfastress
dynlj \
eofsplit exit2 exitval1 exitval2 exitval3 \
fcall_exit fcall_exit2 fldchg fldchgnf fnamedat fnarray fnarray2 \
@@ -2810,6 +2812,11 @@ concat3:
@AWKPATH="$(srcdir)" $(AWK) -f address@hidden >_$@ 2>&1 || echo EXIT
CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
+concat5:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f address@hidden >_$@ 2>&1 || echo EXIT
CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
+
convfmt:
@echo $@
@AWKPATH="$(srcdir)" $(AWK) -f address@hidden >_$@ 2>&1 || echo EXIT
CODE: $$? >>_$@
diff --git a/test/Maketests b/test/Maketests
index c48b76d..84909f3 100644
--- a/test/Maketests
+++ b/test/Maketests
@@ -180,6 +180,11 @@ concat3:
@AWKPATH="$(srcdir)" $(AWK) -f address@hidden >_$@ 2>&1 || echo EXIT
CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
+concat5:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f address@hidden >_$@ 2>&1 || echo EXIT
CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
+
convfmt:
@echo $@
@AWKPATH="$(srcdir)" $(AWK) -f address@hidden >_$@ 2>&1 || echo EXIT
CODE: $$? >>_$@
diff --git a/test/concat5.awk b/test/concat5.awk
new file mode 100644
index 0000000..6bfbb85
--- /dev/null
+++ b/test/concat5.awk
@@ -0,0 +1,7 @@
+BEGIN {
+ OFMT = "%.8g"
+ x = 1
+ x += .1
+ x = (x "a")
+ print x
+}
diff --git a/test/concat5.ok b/test/concat5.ok
new file mode 100644
index 0000000..eea5593
--- /dev/null
+++ b/test/concat5.ok
@@ -0,0 +1 @@
+1.1a
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 7 +++++++
interpret.h | 6 ++++--
test/ChangeLog | 6 ++++++
test/Makefile.am | 4 +++-
test/Makefile.in | 9 ++++++++-
test/Maketests | 5 +++++
test/concat5.awk | 7 +++++++
test/concat5.ok | 1 +
8 files changed, 41 insertions(+), 4 deletions(-)
create mode 100644 test/concat5.awk
create mode 100644 test/concat5.ok
hooks/post-receive
--
gawk
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gawk-diffs] [SCM] gawk branch, gawk-4.1-stable, updated. gawk-4.1.0-996-g2fd82e7,
Andrew J. Schorr <=