From cec96d814a65ffe7fa3f8a80c32068cb1532c4e9 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Sun, 27 Sep 2015 14:05:00 -0700 Subject: Fix cascading message for unbound vars in pattern language. Commit 5ab2b46a on 2011-10-06 introduced a hack for suppressing redundant location informaton being tacked on to an unbound variable error (in the TXR pattern language, not TXR Lisp). This ugly hack broke along the way when uw_throw was changed so that exception arguments are always lists, because it still expects the exception object to be a string. (The breaking change took place in 55cc8493, on 2015-02-06). * match.c (do_txeval): In exception catch, exc is a list, and not a string. --- match.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/match.c b/match.c index b90d342b..7a521416 100644 --- a/match.c +++ b/match.c @@ -1550,8 +1550,10 @@ static val do_txeval(val spec, val form, val bindings, val allow_unbound) } uw_catch (exc_sym, exc) { - if (stringp(exc) && !equal(exc, lit("")) && - chr_str(exc, zero) == chr('(')) + val msg = if3(consp(exc), car(exc), exc); + + if (stringp(msg) && !equal(msg, lit("")) && + chr_str(msg, zero) == chr('(')) { uw_throw (exc_sym, exc); } -- cgit v1.2.3