aboutsummaryrefslogtreecommitdiffstats
path: root/test/let1.awk
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2022-04-14 06:04:39 -0700
committerKaz Kylheku <kaz@kylheku.com>2022-04-14 06:04:39 -0700
commita254e53a2c41763dec57ed213dfbd3fc4463acec (patch)
tree62519200e9d7bb1f1cb7c87f68a1d2da1dbbe97c /test/let1.awk
parent8c9e2dfeee4cb900e071bd50c59e1c1bdc468451 (diff)
downloadegawk-a254e53a2c41763dec57ed213dfbd3fc4463acec.tar.gz
egawk-a254e53a2c41763dec57ed213dfbd3fc4463acec.tar.bz2
egawk-a254e53a2c41763dec57ed213dfbd3fc4463acec.zip
@let: bugfix: must clear dup_ent of re-used symbol.
* symbol.c (install): If parm is a recycled node coming from the parser's let_free or let_gfree stack, it might have non-null dup_ent. We must clear that, otherwise if we install that node as a new entry, it will look like it has ghost duplicate list, corrupting the variable allocation algorithm. * test/let1.awk, test/let1.ok: Add tests, which broke.
Diffstat (limited to 'test/let1.awk')
-rw-r--r--test/let1.awk14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/let1.awk b/test/let1.awk
index a67e3639..413b6e1e 100644
--- a/test/let1.awk
+++ b/test/let1.awk
@@ -143,3 +143,17 @@ BEGIN {
exit 1
}
}
+
+function f5()
+{
+ @let (x = 1) { print "f5", x }
+ @let (x = 1, y = 2) { print "f5", x, y }
+ @let (x = 1, y = 2, z = 3) { print "f5", x, y, z }
+}
+
+BEGIN {
+ f5()
+ @let (x = 1) { print "b6", x }
+ @let (x = 1, y = 2) { print "b6", x, y }
+ @let (x = 1, y = 2, z = 3) { print "b6", x, y, z }
+}