summaryrefslogtreecommitdiff
path: root/gcc/ada/a-coinve.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2015-11-18 10:31:53 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2015-11-18 10:31:53 +0000
commit9cbb8f38a09d2ab5a194452a238d572181889857 (patch)
tree8ea1bc76961d91d23474274e64bf2d0805c59be3 /gcc/ada/a-coinve.adb
parent9462461fbc050bc5350240f870d5720406a56751 (diff)
downloadgcc-9cbb8f38a09d2ab5a194452a238d572181889857.tar.gz
2015-11-18 Ed Schonberg <schonberg@adacore.com>
* sem_ch5.adb (Analyze_Assignment): Diagnose assignment where left-hand side has a limited view of a class-wide type. * sem_ch6.adb (Detected_And_Exchange): Do not install a non-limited view if the scope of the type of the formal is visible through a limited_with_clause, even if the non-limited view is available. 2015-11-18 Emmanuel Briot <briot@adacore.com> * s-pooglo.ads: Make Global_Pool_Object aliased. 2015-11-18 Ed Schonberg <schonberg@adacore.com> * sem_attr.adb (Analyze_Attribute, case 'Access): If the prefix is an expression function, do not analyze the generated body if the current scope is not the scope of the expression function, as may happen if the attribute is an actual in an instantiation. * sem_ch10.adb, sem_ch12.adb, a-stzmap.adb, s-soflin.adb, a-stwima.adb: Fix typos. 2015-11-18 Arnaud Charlet <charlet@adacore.com> * exp_ch11.adb (Expand_N_Exception_Declaration): No-op when generating C code. 2015-11-18 Vincent Celier <celier@adacore.com> * g-comlin.adb (Find_Longest_Matching_Switch): Do not take into account a switch ending with '=' when the actual command line switch is not followed with a space or '='. 2015-11-18 Ed Schonberg <schonberg@adacore.com> * sem_res.adb (Resolve_Explicit_Dereference): Do not add an access check if the type of the prefix is known to exclude null. * a-coinve.adb (Get_Element_Access): The function returns an access type that excludes null, so add an explicit check for a null element pointer, which is created when Insert_Spaces is called on an indefinite vector container. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230533 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/a-coinve.adb')
-rw-r--r--gcc/ada/a-coinve.adb17
1 files changed, 15 insertions, 2 deletions
diff --git a/gcc/ada/a-coinve.adb b/gcc/ada/a-coinve.adb
index 7843b5e1348..ba0f6932471 100644
--- a/gcc/ada/a-coinve.adb
+++ b/gcc/ada/a-coinve.adb
@@ -1076,9 +1076,22 @@ package body Ada.Containers.Indefinite_Vectors is
------------------------
function Get_Element_Access
- (Position : Cursor) return not null Element_Access is
+ (Position : Cursor) return not null Element_Access
+ is
+ Ptr : constant Element_Access :=
+ Position.Container.Elements.EA (Position.Index);
+
begin
- return Position.Container.Elements.EA (Position.Index);
+ -- An indefinite vector may contain spaces that hold no elements.
+ -- Any iteration over an indefinite vector with spaces will raise
+ -- Constraint_Error.
+
+ if Ptr = null then
+ raise Constraint_Error;
+
+ else
+ return Ptr;
+ end if;
end Get_Element_Access;
-----------------