don't trust locations returned by the compiler

This commit is contained in:
Jeremie Dimino 2015-08-04 11:26:28 +01:00
parent bdfecd6fd3
commit fccbafa75b
1 changed files with 1 additions and 1 deletions

View File

@ -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)