From 6c56631a711591a26cc3a7e1b2d12417b8d17c66 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Thu, 27 Apr 2023 07:40:36 +0200 Subject: libraries: avoid a crash when replacing a file without checksum. Fix #2411 --- src/libraries.adb | 6 ++++-- 1 file 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 -- cgit v1.2.3