diff options
author | Tristan Gingold <tgingold@free.fr> | 2019-06-20 19:02:25 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2019-06-20 19:02:25 +0200 |
commit | 1d19b22b3851a92ca908581b006b5642e9fc651e (patch) | |
tree | ccc4ce9bbb9bd363263c43af7c2820116900b247 /src/files_map-editor.adb | |
parent | 1a45a56d43d621a25bbeee8f39c88924b2083e60 (diff) | |
download | ghdl-1d19b22b3851a92ca908581b006b5642e9fc651e.tar.gz ghdl-1d19b22b3851a92ca908581b006b5642e9fc651e.tar.bz2 ghdl-1d19b22b3851a92ca908581b006b5642e9fc651e.zip |
files_map: change the meaning of Get_Buffer_Length for
Diffstat (limited to 'src/files_map-editor.adb')
-rw-r--r-- | src/files_map-editor.adb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/files_map-editor.adb b/src/files_map-editor.adb index ad04973dc..fb5721a47 100644 --- a/src/files_map-editor.adb +++ b/src/files_map-editor.adb @@ -393,6 +393,7 @@ package body Files_Map.Editor is Buf_Len : constant Source_Ptr := Get_Buffer_Length (File); begin if Text_Len + 2 > Buf_Len then + -- Buffer is too small! raise Constraint_Error; end if; @@ -401,6 +402,8 @@ package body Files_Map.Editor is Text_Ptr (Source_Ptr_Org .. Source_Ptr_Org + Text_Len - 1); end if; Set_File_Length (File, Text_Len); + + -- Move the gap after the two terminal EOT. Set_Gap (File, Text_Len + 2, Buf_Len - 1); -- Clear cache. |