From 457b6274e1ce577aa93e7a92456d66c40e9e4a61 Mon Sep 17 00:00:00 2001 From: Robert Dewar Date: Wed, 5 Dec 2001 19:13:59 +0000 Subject: 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 --- gcc/ada/ChangeLog | 5 +++++ gcc/ada/sem_attr.adb | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) 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 + + * 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 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; -- cgit v1.1