aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2023-04-27 07:40:36 +0200
committerTristan Gingold <tgingold@free.fr>2023-04-27 07:40:36 +0200
commit6c56631a711591a26cc3a7e1b2d12417b8d17c66 (patch)
tree3f99298d961369fddfb5d5c45be8da7f774d6876
parent3f1cd8b2da5a3e033ab985879a744741ad97e28f (diff)
downloadghdl-6c56631a711591a26cc3a7e1b2d12417b8d17c66.tar.gz
ghdl-6c56631a711591a26cc3a7e1b2d12417b8d17c66.tar.bz2
ghdl-6c56631a711591a26cc3a7e1b2d12417b8d17c66.zip
libraries: avoid a crash when replacing a file without checksum.
Fix #2411
-rw-r--r--src/libraries.adb6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/libraries.adb b/src/libraries.adb
index 3a1ba7e1c..128b6eefa 100644
--- a/src/libraries.adb
+++ b/src/libraries.adb
@@ -1248,8 +1248,10 @@ package body Libraries is
if Design_File /= Null_Iir
and then New_Lib_Checksum /= No_File_Checksum_Id
- and then not Files_Map.Is_Eq (New_Lib_Checksum,
- Get_File_Checksum (Design_File))
+ and then
+ (Get_File_Checksum (Design_File) = No_File_Checksum_Id
+ or else not Files_Map.Is_Eq (New_Lib_Checksum,
+ Get_File_Checksum (Design_File)))
then
-- FIXME: this test is not enough: what about reanalyzing
-- unmodified files (this works only because the order is not