summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2017-06-19 16:59:59 -0700
committerKaz Kylheku <kaz@kylheku.com>2017-06-19 16:59:59 -0700
commit3b8184d79cf66684b1a2f277d7758335b5d31267 (patch)
treebb02c0043025df5b4d5ee557c0a806586ed2e602
parent917a7a57cfb6b88122f23c02fa7b4bb66511bb9e (diff)
downloadtxr-3b8184d79cf66684b1a2f277d7758335b5d31267.tar.gz
txr-3b8184d79cf66684b1a2f277d7758335b5d31267.tar.bz2
txr-3b8184d79cf66684b1a2f277d7758335b5d31267.zip
bugfix: regression in horizontal @(trailer)
* match.c (h_trailer): Prevent LOG_MATCH call from being evaluated in failed case, when the position is nil. This situation triggers an exception, because LOG_MATCH prints the position as an integer using ~d.
-rw-r--r--match.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/match.c b/match.c
index d06d7c76..a87c09e5 100644
--- a/match.c
+++ b/match.c
@@ -1247,10 +1247,10 @@ static val h_trailer(match_line_ctx *c)
if (!new_pos) {
LOG_MISMATCH("trailer");
ret = nil;
+ } else {
+ LOG_MATCH("trailer", new_pos);
+ ret = cons(new_bindings, plus(c->pos, c->base));
}
-
- LOG_MATCH("trailer", new_pos);
- ret = cons(new_bindings, plus(c->pos, c->base));
}
uw_unwind {