summaryrefslogtreecommitdiff
path: root/gcc/ada/g-pehage.adb
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/g-pehage.adb')
-rw-r--r--gcc/ada/g-pehage.adb10
1 files changed, 9 insertions, 1 deletions
diff --git a/gcc/ada/g-pehage.adb b/gcc/ada/g-pehage.adb
index b59e1ecec98..1b480182441 100644
--- a/gcc/ada/g-pehage.adb
+++ b/gcc/ada/g-pehage.adb
@@ -553,10 +553,18 @@ package body GNAT.Perfect_Hash_Generators is
-- Allocate --
--------------
- function Allocate (N : Natural; S : Natural := 1) return Table_Id is
+ function Allocate (N : Natural; S : Natural := 1) return Table_Id is
L : constant Integer := IT.Last;
begin
IT.Set_Last (L + N * S);
+
+ -- Initialize, so debugging printouts don't trip over uninitialized
+ -- components.
+
+ for J in L + 1 .. IT.Last loop
+ IT.Table (J) := -1;
+ end loop;
+
return L + 1;
end Allocate;