From 787b286207964eb4880ed868f39814732d891482 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Thu, 29 Nov 2018 18:59:55 +0100 Subject: files_map: add assertions. --- src/files_map.adb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/files_map.adb b/src/files_map.adb index abbd0c48c..e9d0a2e9e 100644 --- a/src/files_map.adb +++ b/src/files_map.adb @@ -216,6 +216,10 @@ package body Files_Map is loop << Again >> null; + pragma Assert (Hi >= Low); + pragma Assert (Low >= 1); + pragma Assert (Hi <= Last (Source_File.Lines)); + Mid := (Hi + Low) / 2; if Lines_Table (Mid) = Source_Ptr_Bad then -- There is a hole: no position for this line. -- cgit v1.2.3