]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
sem_attr.adb (Analyze_Attribute): Defend against bad Val attribute.
authorRobert Dewar <dewar@gnat.com>
Wed, 5 Dec 2001 19:13:59 +0000 (19:13 +0000)
committerGeert Bosch <bosch@gcc.gnu.org>
Wed, 5 Dec 2001 19:13:59 +0000 (20:13 +0100)
* sem_attr.adb (Analyze_Attribute): Defend against bad Val attribute.
Fixes compilation abandoned bomb in B24009B.

From-SVN: r47683

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

index 622444d9b47c3152d61494b4c37ed7bd529abb0e..d402685bdff8cfb8caff7e6ef518ba0e3c5241b4 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 9cf41f92e4c0b658f7e1e241eba74dd56ced1d89..97002bb605d62d82360e65cec954a5f8b105c45c 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;