aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_util.adb
diff options
context:
space:
mode:
authorRobert Dewar <dewar@gnat.com>2001-10-26 00:28:10 +0000
committerGeert Bosch <bosch@gcc.gnu.org>2001-10-26 02:28:10 +0200
commitce9e9122644b82b8a0b91be47ffc6a849bb12f4b (patch)
treeaa1a07d24245cb49b2e38f0d7cdde05d54c69b36 /gcc/ada/sem_util.adb
parente12fbc9e0fd83631bf8258404ecd671b720f753e (diff)
downloadgcc-ce9e9122644b82b8a0b91be47ffc6a849bb12f4b.zip
gcc-ce9e9122644b82b8a0b91be47ffc6a849bb12f4b.tar.gz
gcc-ce9e9122644b82b8a0b91be47ffc6a849bb12f4b.tar.bz2
* sem_ch3.adb:
(Analyze_Number_Declaration): Handle error expression. (Signed_Integer_Type_Declaration): Handle error bound. (Analyze_Subtype_Indication): Handle error range. * sem_util.adb (Get_Index_Bounds): Check for Error. From-SVN: r46508
Diffstat (limited to 'gcc/ada/sem_util.adb')
-rw-r--r--gcc/ada/sem_util.adb17
1 files changed, 13 insertions, 4 deletions
diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb
index c247472..da2b6ce 100644
--- a/gcc/ada/sem_util.adb
+++ b/gcc/ada/sem_util.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- $Revision: 1.541 $
+-- $Revision$
-- --
-- Copyright (C) 1992-2001, Free Software Foundation, Inc. --
-- --
@@ -2169,6 +2169,7 @@ package body Sem_Util is
procedure Get_Index_Bounds (N : Node_Id; L, H : out Node_Id) is
Kind : constant Node_Kind := Nkind (N);
+ R : Node_Id;
begin
if Kind = N_Range then
@@ -2176,8 +2177,17 @@ package body Sem_Util is
H := High_Bound (N);
elsif Kind = N_Subtype_Indication then
- L := Low_Bound (Range_Expression (Constraint (N)));
- H := High_Bound (Range_Expression (Constraint (N)));
+ R := Range_Expression (Constraint (N));
+
+ if R = Error then
+ L := Error;
+ H := Error;
+ return;
+
+ else
+ L := Low_Bound (Range_Expression (Constraint (N)));
+ H := High_Bound (Range_Expression (Constraint (N)));
+ end if;
elsif Is_Entity_Name (N) and then Is_Type (Entity (N)) then
if Error_Posted (Scalar_Range (Entity (N))) then
@@ -2198,7 +2208,6 @@ package body Sem_Util is
L := N;
H := N;
end if;
-
end Get_Index_Bounds;
------------------------