summaryrefslogtreecommitdiffstats
path: root/eval.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2016-01-09 22:02:23 -0800
committerKaz Kylheku <kaz@kylheku.com>2016-01-09 22:02:23 -0800
commitd0c3ee7233765e807cf4c8a0615245ac6dcf8996 (patch)
tree5629d4a34da35006e97efc67cb6e70b77adbaa87 /eval.c
parent41e5183c51e48cd2854099159a173da10eb30b8b (diff)
downloadtxr-d0c3ee7233765e807cf4c8a0615245ac6dcf8996.tar.gz
txr-d0c3ee7233765e807cf4c8a0615245ac6dcf8996.tar.bz2
txr-d0c3ee7233765e807cf4c8a0615245ac6dcf8996.zip
Don't record form as its own macro origin.
* eval.c (set_origin): Add form != origin to the condition for recording the ancestry. (expand_macro): Use set_origin function instead of direct call to sethash.
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/eval.c b/eval.c
index cbc5e89b..bc509986 100644
--- a/eval.c
+++ b/eval.c
@@ -223,7 +223,7 @@ val lookup_origin(val form)
static val set_origin(val form, val origin)
{
- if (origin)
+ if (origin && form != origin)
sethash(origin_hash, form, origin);
return form;
}
@@ -1619,7 +1619,7 @@ static val expand_macro(val form, val mac_binding, val menv)
result = eval_progn(body, exp_env, body);
debug_end;
set_dyn_env(saved_de);
- sethash(origin_hash, result, form);
+ set_origin(result, form);
debug_return(result);
debug_leave;
}