OSDN Git Service

* sem_attr.adb (Analyze_Attribute): Defend against bad Val attribute.
authorbosch <bosch@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 5 Dec 2001 19:13:59 +0000 (19:13 +0000)
committerbosch <bosch@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 5 Dec 2001 19:13:59 +0000 (19:13 +0000)
Fixes compilation abandoned bomb in B24009B.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@47683 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ada/ChangeLog
gcc/ada/sem_attr.adb

index 622444d..d402685 100644 (file)
@@ -1,3 +1,8 @@
+2001-12-05  Robert Dewar <dewar@gnat.com>
+
+       * sem_attr.adb (Analyze_Attribute): Defend against bad Val attribute. 
+       Fixes compilation abandoned bomb in B24009B.
+
 2001-12-05  Ed Schonberg <schonber@gnat.com>
 
        * sem_ch12.adb:
index 9cf41f9..97002bb 100644 (file)
@@ -1476,7 +1476,9 @@ package body Sem_Attr is
          E1 := First (Exprs);
          Analyze (E1);
 
-         if Etype (E1) = Any_Type then
+         --  Check for missing or bad expression (result of previous error)
+
+         if No (E1) or else Etype (E1) = Any_Type then
             raise Bad_Attribute;
          end if;