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
commit92d273995c487edcffde501bf05a2905aef2e99c (patch)
treebb02c0043025df5b4d5ee557c0a806586ed2e602
parentc9fe7cc60c78e122e1943a6c664231460cb25539 (diff)
downloadtxr-92d273995c487edcffde501bf05a2905aef2e99c.tar.gz
txr-92d273995c487edcffde501bf05a2905aef2e99c.tar.bz2
txr-92d273995c487edcffde501bf05a2905aef2e99c.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 {