[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gawk-diffs] [SCM] gawk branch, master, updated. gawk-4.1.0-1492-g2befea
From: |
Arnold Robbins |
Subject: |
[gawk-diffs] [SCM] gawk branch, master, updated. gawk-4.1.0-1492-g2befea5 |
Date: |
Sun, 28 Jun 2015 19:22:38 +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, master has been updated
via 2befea585a321d9d092bfb99cbfa65350a839752 (commit)
via 741bf93462919d841ffd7f3ed8c85a202b9dc3f8 (commit)
via 687e6594ca3a6195ef834a5466b5fc7de2de2d7b (commit)
from 8a4905be350313d41f6c0b20497809760d7fa84e (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=2befea585a321d9d092bfb99cbfa65350a839752
commit 2befea585a321d9d092bfb99cbfa65350a839752
Author: Arnold D. Robbins <address@hidden>
Date: Sun Jun 28 22:22:03 2015 +0300
Add thanks to test/ChangeLog entry.
diff --git a/test/ChangeLog b/test/ChangeLog
index 6871837..f29dea7 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -2,6 +2,7 @@
* Makefile.am (typedregex2): New test.
* typedregex2.awk, typedregex2.ok: New files.
+ Thanks to Hermann Peifer for the report.
2015-06-26 Arnold D. Robbins <address@hidden>
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=741bf93462919d841ffd7f3ed8c85a202b9dc3f8
commit 741bf93462919d841ffd7f3ed8c85a202b9dc3f8
Author: Arnold D. Robbins <address@hidden>
Date: Sun Jun 28 22:21:23 2015 +0300
Additional memory fixes and test for typedregex.
diff --git a/ChangeLog b/ChangeLog
index 2d94bf7..a526706 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,7 @@
* awkgram.y (make_regnode): Set valref to 1.
* interpret.h (r_interpret): Have Op_push_re upref typed regexp.
* builtin.c (do_typeof): OK to deref typed regex.
+ * awk.h (force_string): Do dupnode on the regexp text.
2015-06-26 Arnold D. Robbins <address@hidden>
diff --git a/awk.h b/awk.h
index 0c30cbd..53af7f1 100644
--- a/awk.h
+++ b/awk.h
@@ -1764,7 +1764,7 @@ static inline NODE *
force_string(NODE *s)
{
if (s->type == Node_typedregex)
- return s->re_exp;
+ return dupnode(s->re_exp);
if ((s->flags & STRCUR) != 0
&& (s->stfmt == -1 || s->stfmt == CONVFMTidx)
diff --git a/test/ChangeLog b/test/ChangeLog
index b121fbe..6871837 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,8 @@
+2015-06-28 Arnold D. Robbins <address@hidden>
+
+ * Makefile.am (typedregex2): New test.
+ * typedregex2.awk, typedregex2.ok: New files.
+
2015-06-26 Arnold D. Robbins <address@hidden>
* Makefile.am (dbugtypedre1): Renamed from dbugtypedre.
diff --git a/test/Makefile.am b/test/Makefile.am
index cfcc9d9..df1f1e2 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -989,6 +989,8 @@ EXTRA_DIST = \
tweakfld.ok \
typedregex1.awk \
typedregex1.ok \
+ typedregex2.awk \
+ typedregex2.ok \
typeof1.awk \
typeof1.ok \
typeof2.awk \
@@ -1112,7 +1114,7 @@ GAWK_EXT_TESTS = \
splitarg4 strftime \
strtonum switch2 symtab1 symtab2 symtab3 symtab4 symtab5 symtab6 \
symtab7 symtab8 symtab9 \
- typedregex1 typeof1 typeof2 typeof3 typeof4
+ typedregex1 typedregex2 typeof1 typeof2 typeof3 typeof4
timeout
EXTRA_TESTS = inftest regtest
diff --git a/test/Makefile.in b/test/Makefile.in
index f850f59..ec270c1 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -1246,6 +1246,8 @@ EXTRA_DIST = \
tweakfld.ok \
typedregex1.awk \
typedregex1.ok \
+ typedregex2.awk \
+ typedregex2.ok \
typeof1.awk \
typeof1.ok \
typeof2.awk \
@@ -1368,7 +1370,7 @@ GAWK_EXT_TESTS = \
splitarg4 strftime \
strtonum switch2 symtab1 symtab2 symtab3 symtab4 symtab5 symtab6 \
symtab7 symtab8 symtab9 \
- typedregex1 typeof1 typeof2 typeof3 typeof4
+ typedregex1 typedregex2 typeof1 typeof2 typeof3 typeof4
EXTRA_TESTS = inftest regtest
INET_TESTS = inetdayu inetdayt inetechu inetecht
@@ -3923,6 +3925,11 @@ typedregex1:
@AWKPATH="$(srcdir)" $(AWK) -f address@hidden >_$@ 2>&1 || echo EXIT
CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
+typedregex2:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f address@hidden >_$@ 2>&1 || echo EXIT
CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
+
typeof1:
@echo $@
@AWKPATH="$(srcdir)" $(AWK) -f address@hidden >_$@ 2>&1 || echo EXIT
CODE: $$? >>_$@
diff --git a/test/Maketests b/test/Maketests
index e4cea0d..462128e 100644
--- a/test/Maketests
+++ b/test/Maketests
@@ -1337,6 +1337,11 @@ typedregex1:
@AWKPATH="$(srcdir)" $(AWK) -f address@hidden >_$@ 2>&1 || echo EXIT
CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
+typedregex2:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f address@hidden >_$@ 2>&1 || echo EXIT
CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
+
typeof1:
@echo $@
@AWKPATH="$(srcdir)" $(AWK) -f address@hidden >_$@ 2>&1 || echo EXIT
CODE: $$? >>_$@
diff --git a/test/typedregex2.awk b/test/typedregex2.awk
new file mode 100644
index 0000000..e17df4b
--- /dev/null
+++ b/test/typedregex2.awk
@@ -0,0 +1,11 @@
+BEGIN {
+ x = @/xxx/
+ y = @/yyy/
+ print typeof(x), typeof(y)
+ print x, y
+
+ x++
+ y = y ""
+ print typeof(x), typeof(y)
+ print x, y
+}
diff --git a/test/typedregex2.ok b/test/typedregex2.ok
new file mode 100644
index 0000000..832ef55
--- /dev/null
+++ b/test/typedregex2.ok
@@ -0,0 +1,4 @@
+regexp regexp
+xxx yyy
+number string
+1 yyy
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=687e6594ca3a6195ef834a5466b5fc7de2de2d7b
commit 687e6594ca3a6195ef834a5466b5fc7de2de2d7b
Author: Arnold D. Robbins <address@hidden>
Date: Sun Jun 28 22:08:12 2015 +0300
Improve memory tracking on typed regex.
diff --git a/ChangeLog b/ChangeLog
index 2a018fe..2d94bf7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2015-06-28 Arnold D. Robbins <address@hidden>
+
+ Improve memory tracking of typed regexps.
+
+ * awkgram.y (make_regnode): Set valref to 1.
+ * interpret.h (r_interpret): Have Op_push_re upref typed regexp.
+ * builtin.c (do_typeof): OK to deref typed regex.
+
2015-06-26 Arnold D. Robbins <address@hidden>
Remove support for old-style extensions.
diff --git a/awkgram.c b/awkgram.c
index 88e02af..0ee3e66 100644
--- a/awkgram.c
+++ b/awkgram.c
@@ -7286,6 +7286,7 @@ make_regnode(int type, NODE *exp)
}
n->re_exp = exp;
n->re_flags = CONSTANT;
+ n->valref = 1;
}
return n;
}
diff --git a/awkgram.y b/awkgram.y
index c2dbdb4..4f22379 100644
--- a/awkgram.y
+++ b/awkgram.y
@@ -4866,6 +4866,7 @@ make_regnode(int type, NODE *exp)
}
n->re_exp = exp;
n->re_flags = CONSTANT;
+ n->valref = 1;
}
return n;
}
diff --git a/builtin.c b/builtin.c
index 6ad4de3..c28cd0a 100644
--- a/builtin.c
+++ b/builtin.c
@@ -3884,9 +3884,7 @@ do_typeof(int nargs)
deref = false;
break;
case Node_typedregex:
- /* Op_push_re does not UPREF */
res = "regexp";
- deref = false;
break;
case Node_val:
case Node_var:
diff --git a/interpret.h b/interpret.h
index fab4f1c..0a5cbbf 100644
--- a/interpret.h
+++ b/interpret.h
@@ -990,6 +990,8 @@ arrayfor:
r = POP_STRING();
unref(m->re_exp);
m->re_exp = r;
+ } else if (m->type == Node_typedregex) {
+ UPREF(m);
}
PUSH(m);
break;
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 9 +++++++++
awk.h | 2 +-
awkgram.c | 1 +
awkgram.y | 1 +
builtin.c | 2 --
interpret.h | 2 ++
test/ChangeLog | 6 ++++++
test/Makefile.am | 4 +++-
test/Makefile.in | 9 ++++++++-
test/Maketests | 5 +++++
test/typedregex2.awk | 11 +++++++++++
test/typedregex2.ok | 4 ++++
12 files changed, 51 insertions(+), 5 deletions(-)
create mode 100644 test/typedregex2.awk
create mode 100644 test/typedregex2.ok
hooks/post-receive
--
gawk
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gawk-diffs] [SCM] gawk branch, master, updated. gawk-4.1.0-1492-g2befea5,
Arnold Robbins <=