From: Robert Dewar Date: Wed, 5 Dec 2001 19:13:59 +0000 (+0000) Subject: sem_attr.adb (Analyze_Attribute): Defend against bad Val attribute. X-Git-Tag: prereleases/libstdc++-3.0.95~444 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=457b6274e1ce577aa93e7a92456d66c40e9e4a61;p=thirdparty%2Fgcc.git 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 --- diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 622444d9b47c..d402685bdff8 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,8 @@ +2001-12-05 Robert Dewar + + * sem_attr.adb (Analyze_Attribute): Defend against bad Val attribute. + Fixes compilation abandoned bomb in B24009B. + 2001-12-05 Ed Schonberg * sem_ch12.adb: diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb index 9cf41f92e4c0..97002bb605d6 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;