summaryrefslogtreecommitdiff
path: root/gcc/ada/a-cforma.adb
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/a-cforma.adb')
-rw-r--r--gcc/ada/a-cforma.adb4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/ada/a-cforma.adb b/gcc/ada/a-cforma.adb
index ac763918283..33cd101badc 100644
--- a/gcc/ada/a-cforma.adb
+++ b/gcc/ada/a-cforma.adb
@@ -283,6 +283,10 @@ package body Ada.Containers.Formal_Ordered_Maps is
N : Count_Type;
begin
+ if 0 < Capacity and then Capacity < Source.Capacity then
+ raise Capacity_Error;
+ end if;
+
return Target : Map (Count_Type'Max (Source.Capacity, Capacity)) do
if Length (Source) > 0 then
Target.Length := Source.Length;