aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--eval.c2
-rw-r--r--test/ChangeLog5
-rw-r--r--test/Makefile.am4
-rw-r--r--test/Makefile.in9
-rw-r--r--test/Maketests5
-rw-r--r--test/aryprm9.awk16
-rw-r--r--test/aryprm9.ok0
8 files changed, 45 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 10716022..93b91427 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2016-01-14 Arnold D. Robbins <arnold@skeeve.com>
+
+ * eval.c (r_get_lhs): If original array was Node_var_new,
+ assign value that is dupnode of Nnull_string and not
+ Nnull_string directly. Fixes core dump reported by
+ ruyk <Lonely.ruyk@mail.ru>.
+
2016-01-02 Arnold D. Robbins <arnold@skeeve.com>
* dfa.c (add_utf8_anychar): Minor change in declaration of
diff --git a/eval.c b/eval.c
index 05924cda..291d0846 100644
--- a/eval.c
+++ b/eval.c
@@ -1154,7 +1154,7 @@ r_get_lhs(NODE *n, bool reference)
array_vname(n));
if (n->orig_array->type != Node_var) {
n->orig_array->type = Node_var;
- n->orig_array->var_value = Nnull_string;
+ n->orig_array->var_value = dupnode(Nnull_string);
}
/* fall through */
case Node_var_new:
diff --git a/test/ChangeLog b/test/ChangeLog
index 6bed9696..10e942b8 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,8 @@
+2016-01-14 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (aryprm9): New test.
+ * aryprm9.awk, aryprm9.ok: New files.
+
2015-12-27 Arnold D. Robbins <arnold@skeeve.com>
* Makefile.am (profile8): New test.
diff --git a/test/Makefile.am b/test/Makefile.am
index 01c15233..540e8d99 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -93,6 +93,8 @@ EXTRA_DIST = \
aryprm7.ok \
aryprm8.awk \
aryprm8.ok \
+ aryprm9.awk \
+ aryprm9.ok \
arysubnm.awk \
arysubnm.ok \
asgext.awk \
@@ -1030,7 +1032,7 @@ BASIC_TESTS = \
addcomma anchgsub argarray arrayparm arrayprm2 arrayprm3 \
arrayref arrymem1 arryref2 arryref3 arryref4 arryref5 arynasty \
arynocls aryprm1 aryprm2 aryprm3 aryprm4 aryprm5 aryprm6 aryprm7 \
- aryprm8 arysubnm asgext awkpath \
+ aryprm8 aryprm9 arysubnm asgext awkpath \
back89 backgsub badassign1 badbuild \
callparam childin clobber closebad clsflnam compare compare2 concat1 concat2 \
concat3 concat4 convfmt \
diff --git a/test/Makefile.in b/test/Makefile.in
index a89fc862..723c39e1 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -350,6 +350,8 @@ EXTRA_DIST = \
aryprm7.ok \
aryprm8.awk \
aryprm8.ok \
+ aryprm9.awk \
+ aryprm9.ok \
arysubnm.awk \
arysubnm.ok \
asgext.awk \
@@ -1286,7 +1288,7 @@ BASIC_TESTS = \
addcomma anchgsub argarray arrayparm arrayprm2 arrayprm3 \
arrayref arrymem1 arryref2 arryref3 arryref4 arryref5 arynasty \
arynocls aryprm1 aryprm2 aryprm3 aryprm4 aryprm5 aryprm6 aryprm7 \
- aryprm8 arysubnm asgext awkpath \
+ aryprm8 aryprm9 arysubnm asgext awkpath \
back89 backgsub badassign1 badbuild \
callparam childin clobber closebad clsflnam compare compare2 concat1 concat2 \
concat3 concat4 convfmt \
@@ -2660,6 +2662,11 @@ aryprm8:
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+aryprm9:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
arysubnm:
@echo $@
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
diff --git a/test/Maketests b/test/Maketests
index bb5712d5..214f5ddb 100644
--- a/test/Maketests
+++ b/test/Maketests
@@ -100,6 +100,11 @@ aryprm8:
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+aryprm9:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
arysubnm:
@echo $@
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
diff --git a/test/aryprm9.awk b/test/aryprm9.awk
new file mode 100644
index 00000000..004e3c34
--- /dev/null
+++ b/test/aryprm9.awk
@@ -0,0 +1,16 @@
+#!/usr/bin/gawk -f
+BEGIN {
+
+ for (i = 0; i < 100; i++)
+ func_exec()
+}
+
+function func_exec(opaque)
+{
+ func_a(1, opaque) #set additional argument, not expected by fname
+}
+
+function func_a(a, b, loc1, loc2)
+{
+ b = 0 #unref Nnull_string
+}
diff --git a/test/aryprm9.ok b/test/aryprm9.ok
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/aryprm9.ok