]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[Ada] Gnatbind crash during checksum calculation
authorJustin Squirek <squirek@adacore.com>
Tue, 10 May 2022 18:19:10 +0000 (18:19 +0000)
committerPierre-Marie de Rodat <derodat@adacore.com>
Thu, 2 Jun 2022 09:06:37 +0000 (09:06 +0000)
This patch corrects an error in the compiler whereby gnatbind may crash
during calculation of file checksums in certain corner cases due to
uninitialized lookup tables.

gcc/ada/

* gnatbind.adb (Gnatbind): Add initialize call for Uintp
* gnatls.adb (Gnatls): Likewise.
* gprep.adb (Gnatprep): Likewise.
* make.adb (Initialize): Likewise.

gcc/ada/gnatbind.adb
gcc/ada/gnatls.adb
gcc/ada/gprep.adb
gcc/ada/make.adb

index 4c50e61617da3a1f3f8519390b40b99d93b7abb8..475702a755e018eb015a51155d5991b09dc0ad84 100644 (file)
@@ -50,6 +50,7 @@ with Switch;   use Switch;
 with Switch.B; use Switch.B;
 with Targparm; use Targparm;
 with Types;    use Types;
+with Uintp;
 
 with System.Case_Util; use System.Case_Util;
 with System.Response_File;
@@ -617,6 +618,7 @@ begin
    --  is in some cases important.
 
    Csets.Initialize;
+   Uintp.Initialize;
    Snames.Initialize;
 
    --  Scan the switches and arguments. Note that Snames must already be
index 4b6ba0394defb9094cf68f6c78934423f82d4de3..9b62f71d68e0fe798ae55c5d6bcfaba71899dfc8 100644 (file)
@@ -44,6 +44,7 @@ with Snames;
 with Stringt;
 with Switch;      use Switch;
 with Types;       use Types;
+with Uintp;
 
 with GNAT.Case_Util;            use GNAT.Case_Util;
 with GNAT.Command_Line;         use GNAT.Command_Line;
@@ -2023,6 +2024,7 @@ begin
    --  Initialize standard packages
 
    Csets.Initialize;
+   Uintp.Initialize;
    Snames.Initialize;
    Stringt.Initialize;
 
index 36ec1d81e2e004e12fa8ea900509bcc2eb9caa0a..58ae1044b3b8a73702a8688ec9fdaa9154deee30 100644 (file)
@@ -37,6 +37,7 @@ with Snames;
 with Stringt;  use Stringt;
 with Switch;   use Switch;
 with Types;    use Types;
+with Uintp;
 
 with Ada.Command_Line; use Ada.Command_Line;
 with Ada.Text_IO;      use Ada.Text_IO;
@@ -169,6 +170,7 @@ package body GPrep is
       --  Do some initializations (order is important here)
 
       Csets.Initialize;
+      Uintp.Initialize;
       Snames.Initialize;
       Stringt.Initialize;
       Prep.Initialize;
index bbabd76c21189fe952a6cac77c589b4a6d80d526..3ed465612b0b2786465067d1123a9f8bf8438148 100644 (file)
@@ -44,6 +44,7 @@ with SFN_Scan;
 with Sinput;
 with Snames;
 with Stringt;
+with Uintp;
 
 pragma Warnings (Off);
 with System.HTable;
@@ -3676,6 +3677,7 @@ package body Make is
       Linker_Switches.Init;
 
       Csets.Initialize;
+      Uintp.Initialize;
       Snames.Initialize;
       Stringt.Initialize;