summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2016-04-13 20:00:31 -0700
committerKaz Kylheku <kaz@kylheku.com>2016-04-13 20:00:31 -0700
commitb6403cfaa935cd7b144cb6c1c15ba9cfacd73441 (patch)
treea10696d50af4a19b7551c2a73a43c003c5d0bdac
parentd32108aad0575f904286c37146906fba4409c4de (diff)
downloadtxr-b6403cfaa935cd7b144cb6c1c15ba9cfacd73441.tar.gz
txr-b6403cfaa935cd7b144cb6c1c15ba9cfacd73441.tar.bz2
txr-b6403cfaa935cd7b144cb6c1c15ba9cfacd73441.zip
Bugfix: track origin for built-in macros.
This fix is no longer that important, since due to the previous commit, expand now tracks expansion origins thoroughly, which hides this bug. However, expand_macro is directly called from a few other functions, like macroexpand, which don't benefit from that fix. * eval.c (expand_macro): Add forgotten set_origin call in the case when the native C expander is called.
-rw-r--r--eval.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/eval.c b/eval.c
index a40f41b7..a0926a1d 100644
--- a/eval.c
+++ b/eval.c
@@ -1602,6 +1602,7 @@ static val expand_macro(val form, val mac_binding, val menv)
if (cobjp(expander)) {
mefun_t fp = coerce(mefun_t, cptr_get(expander));
val expanded = fp(form, menv);
+ set_origin(expanded, form);
return expanded;
} else {
debug_enter;