From fccbafa75bd0ea06967570af3c4ebbc9ed923ca0 Mon Sep 17 00:00:00 2001 From: Jeremie Dimino Date: Tue, 4 Aug 2015 11:26:28 +0100 Subject: [PATCH] don't trust locations returned by the compiler --- src/lib/uTop_main.cppo.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/uTop_main.cppo.ml b/src/lib/uTop_main.cppo.ml index c01cdb0..5bdb138 100644 --- a/src/lib/uTop_main.cppo.ml +++ b/src/lib/uTop_main.cppo.ml @@ -199,7 +199,7 @@ class read_phrase ~term = object(self) (* Highlight error locations. *) List.iter (fun (start, stop) -> - for i = start to stop - 1 do + for i = max 0 start to min (Array.length styled) stop - 1 do let ch, style = styled.(i) in styled.(i) <- (ch, { style with LTerm_style.underline = Some true }) done)