fix: index out of bounds
This commit is contained in:
parent
accf198a88
commit
2dfde4637f
1 changed files with 2 additions and 0 deletions
|
|
@ -63,6 +63,8 @@ partial def toPosition (fmap : FileMap) (pos : String.Pos) : Position :=
|
|||
else if pos > posM then loop m e
|
||||
else loop b m
|
||||
loop 0 (ps.size -1)
|
||||
else if lines.isEmpty then
|
||||
⟨0, 0⟩
|
||||
else
|
||||
-- Some systems like the delaborator use synthetic positions without an input file,
|
||||
-- which would violate `toPositionAux`'s invariant.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue