aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2020-02-04 18:56:49 +0100
committerTristan Gingold <tgingold@free.fr>2020-02-04 18:56:49 +0100
commita3c8e965181a81710d1da42a32e0efcd376df1bb (patch)
treeb1e6116f8c951d874e2ce17603dce9ac4508c766 /src
parent6bc84d1de4776a15939cf2b72021bdf0b97b930d (diff)
downloadghdl-a3c8e965181a81710d1da42a32e0efcd376df1bb.tar.gz
ghdl-a3c8e965181a81710d1da42a32e0efcd376df1bb.tar.bz2
ghdl-a3c8e965181a81710d1da42a32e0efcd376df1bb.zip
files_map-editor: add more checks.
Diffstat (limited to 'src')
-rw-r--r--src/files_map-editor.adb9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/files_map-editor.adb b/src/files_map-editor.adb
index 63a72f460..d339f3578 100644
--- a/src/files_map-editor.adb
+++ b/src/files_map-editor.adb
@@ -84,6 +84,15 @@ package body Files_Map.Editor is
P : Source_Ptr;
Nl : Natural;
begin
+ -- Check File_Length.
+ P := F.File_Length;
+ if P >= Get_Buffer_Length (File) then
+ Log_Line ("invalid file length");
+ end if;
+ if F.Source (P) /= EOT or else F.Source (P + 1) /= EOT then
+ Log_Line ("missing EOT at end of buffer");
+ end if;
+
L := 1;
P := Source_Ptr_Org;
Main_Loop: loop