summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2015-02-06 07:13:24 -0800
committerKaz Kylheku <kaz@kylheku.com>2015-02-06 07:13:24 -0800
commit3b7f7ef0422537391879d356e61baa50f74483a1 (patch)
tree48d555cdb70a6c7992f1401588ff2c0d292c9204
parentee21c61785cead30fb0f1cde1f6fd9900e358268 (diff)
downloadtxr-3b7f7ef0422537391879d356e61baa50f74483a1.tar.gz
txr-3b7f7ef0422537391879d356e61baa50f74483a1.tar.bz2
txr-3b7f7ef0422537391879d356e61baa50f74483a1.zip
Serious bugfix in the op macro, and derived macro, in
the handling of missing meta-numbers (for instance (op ... @1 .. @3): 1 and 3 occur, but not 2. * eval.c (supplement_op_syms): Bugfix: loop was testing and updating the wrong variable, causing it to be looking at the first element of the syms list in every iteration. Not a regression: this was implemented wrong when the function was introduced on October 6, 2013.
-rw-r--r--ChangeLog12
-rw-r--r--eval.c4
2 files changed, 13 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 474d65eb..4243ab4c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,17 @@
2015-02-06 Kaz Kylheku <kaz@kylheku.com>
+ Serious bugfix in the op macro, and derived macro, in
+ the handling of missing meta-numbers (for
+ instance (op ... @1 .. @3): 1 and 3 occur, but not 2.
+
+ * eval.c (supplement_op_syms): Bugfix: loop was testing
+ and updating the wrong variable, causing it to be looking at the first
+ element of the syms list in every iteration.
+ Not a regression: this was implemented wrong when the function
+ was introduced on October 6, 2013.
+
+2015-02-06 Kaz Kylheku <kaz@kylheku.com>
+
* eval.c (subst_vars): Bugfix. When an ordinary variable
occurs in the quasi syntax (which is the result of substitution
of metanums like @1 by the op macro), if that variable
diff --git a/eval.c b/eval.c
index 87616a08..7e27c962 100644
--- a/eval.c
+++ b/eval.c
@@ -2542,9 +2542,7 @@ static val supplement_op_syms(val ssyms, val max)
list_collect_decl (outsyms, tl);
val si, ni;
- for (si = ssyms, ni = one;
- ssyms;
- ni = plus(ni, one), ssyms = cdr(ssyms))
+ for (si = ssyms, ni = one; si; ni = plus(ni, one), si = cdr(si))
{
val entry = car(si);
val num = car(entry);