diff options
author | Robert Dewar <dewar@gnat.com> | 2001-12-05 19:13:59 +0000 |
---|---|---|
committer | Geert Bosch <bosch@gcc.gnu.org> | 2001-12-05 20:13:59 +0100 |
commit | 457b6274e1ce577aa93e7a92456d66c40e9e4a61 (patch) | |
tree | c2e9f0806c77dfbb6a94962c65d5cc2a6ef7bed1 | |
parent | 193499258fd7bc513161419158b590425e1697e0 (diff) | |
download | gcc-457b6274e1ce577aa93e7a92456d66c40e9e4a61.zip gcc-457b6274e1ce577aa93e7a92456d66c40e9e4a61.tar.gz gcc-457b6274e1ce577aa93e7a92456d66c40e9e4a61.tar.bz2 |
sem_attr.adb (Analyze_Attribute): Defend against bad Val attribute.
* sem_attr.adb (Analyze_Attribute): Defend against bad Val attribute.
Fixes compilation abandoned bomb in B24009B.
From-SVN: r47683
-rw-r--r-- | gcc/ada/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/ada/sem_attr.adb | 4 |
2 files changed, 8 insertions, 1 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 622444d..d402685 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -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: diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb index 9cf41f9..97002bb 100644 --- a/gcc/ada/sem_attr.adb +++ b/gcc/ada/sem_attr.adb @@ -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; |