From 6597ea5e7359f3936d6e73cccc142cd107e17a9f Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Sat, 26 Mar 2016 21:43:18 -0700 Subject: Bugfix in error location reporting across macro expansions. * eval.c (do_expand, macroexpand_1): The original form must have priority in providing source location info, over the macro. Otherwise macro bodies may get reported as locations of errors that occur in substituted code. --- eval.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eval.c b/eval.c index f976673b..51530dcc 100644 --- a/eval.c +++ b/eval.c @@ -3518,7 +3518,7 @@ tail: val mac_expand = expand_macro(form, macro, menv); if (mac_expand == form) return form; - form = rlcp_tree(rlcp_tree(mac_expand, macro), form); + form = rlcp_tree(rlcp_tree(mac_expand, form), macro); goto tail; } else if (sym == progn_s) { val args = rest(form); @@ -3587,7 +3587,7 @@ static val macroexpand_1(val form, val menv) val mac_expand = expand_macro(form, macro, menv); if (mac_expand == form) return form; - return rlcp_tree(rlcp_tree(mac_expand, macro), form); + return rlcp_tree(rlcp_tree(mac_expand, form), macro); } if (bindable(form) && (macro = lookup_symac(menv, form))) { -- cgit v1.2.3