summaryrefslogtreecommitdiff
path: root/err.c
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2020-04-23 14:01:20 -0400
committerLeo Tenenbaum <pommicket@gmail.com>2020-04-23 14:01:20 -0400
commitf7bfb9492ab546e886fd40bda1a0ab25fcb05247 (patch)
tree1ec694390050cc3eb21009963d40dc6655c0a5fa /err.c
parent4062e5c965bc04ec9654d82526e5e785f7f45d03 (diff)
fixed error printing problem, added new test: use
Diffstat (limited to 'err.c')
-rw-r--r--err.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/err.c b/err.c
index 9fada7b..01e3de2 100644
--- a/err.c
+++ b/err.c
@@ -83,6 +83,7 @@ static void err_fprint(ErrCtx *ctx, const char *fmt, ...) {
}
static void print_location_highlight(FILE *out, Location where) {
+ assert(where.end >= where.start);
File *f = where.file;
ErrCtx *ctx = f->ctx;
if (where.start == 0 && where.end == 0) { err_fprint(ctx, "\n"); return; } /* null location */