summaryrefslogtreecommitdiffstats
path: root/eval.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2013-10-27 14:49:42 -0700
committerKaz Kylheku <kaz@kylheku.com>2013-10-27 14:49:42 -0700
commit86ca707c11b05a6cd17a26223e1a6c936b0b83c0 (patch)
tree53f5e868a07ccdab522c9d40f96b0450213b1448 /eval.c
parent0ec17325b3ee76e7fa558aaf8c6727a25bbda3ab (diff)
downloadtxr-86ca707c11b05a6cd17a26223e1a6c936b0b83c0.tar.gz
txr-86ca707c11b05a6cd17a26223e1a6c936b0b83c0.tar.bz2
txr-86ca707c11b05a6cd17a26223e1a6c936b0b83c0.zip
Fix 2013-10-06 regression in op syntax. This happens when a @var
syntax appears in an op form, crashing the expander with infinite recursion at program load time, before the code is run. * eval.c (transform_op): The fi == var check to handle a trailing op variable in the dot position of a form needs to ensure that it really is @<num> type var, and not the @<sym> type for instance.
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/eval.c b/eval.c
index 1471e9be..162b0c91 100644
--- a/eval.c
+++ b/eval.c
@@ -1506,7 +1506,9 @@ static val transform_op(val forms, val syms, val rg)
val fi = first(forms);
val re = rest(forms);
- if (fi == var_s) {
+ /* This handles improper list forms like (a b c . @42)
+ when the recursion hits the @42 part. */
+ if (fi == var_s && integerp(car(re))) {
cons_bind (outsyms, outforms, transform_op(cons(forms, nil), syms, rg));
return cons(outsyms, rlcp(car(outforms), outforms));
}