summaryrefslogtreecommitdiffstats
path: root/eval.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2015-12-29 06:56:21 -0800
committerKaz Kylheku <kaz@kylheku.com>2015-12-29 06:56:21 -0800
commit270a2c302cd6aaed472d00e04f4a34443104fdc4 (patch)
tree3dc22139fc829cb75c519b75b7252f8bedccbedb /eval.c
parent663729d0ff4961ea2ea904aa4de9f15c07ba632d (diff)
downloadtxr-270a2c302cd6aaed472d00e04f4a34443104fdc4.tar.gz
txr-270a2c302cd6aaed472d00e04f4a34443104fdc4.tar.bz2
txr-270a2c302cd6aaed472d00e04f4a34443104fdc4.zip
Detect loop in error_trace.
* eval.c (error_trace): If a form has itself as its macro ancestor, bail the loop. (This only happens in deliberately contrived pathological cases, useful for testing).
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/eval.c b/eval.c
index 07791880..3ab401e4 100644
--- a/eval.c
+++ b/eval.c
@@ -267,6 +267,9 @@ void error_trace(val exsym, val exvals, val out_stream, val prefix)
format(out_stream, lit("~a whose location is unavailable\n"), prefix,
nao);
}
+
+ if (origin == last)
+ break;
}
}