diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-07-30 15:52:58 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-07-30 15:52:58 +0000 |
commit | bd507c5d80e60a9c2611030103deca12ea816d68 (patch) | |
tree | 73834d6791dd4a6ffb55a7f7466b9fa288ad731b /gcc/ada/exp_util.adb | |
parent | 2717c27105117addc425ac16a3d916b627b560e4 (diff) | |
download | gcc-bd507c5d80e60a9c2611030103deca12ea816d68.tar.gz |
2008-07-30 Ed Schonberg <schonberg@adacore.com>
* sem_ch8.adb (Analyze_Subprogram_Renaming): When renaming an attribute
as a actual in an instance, check for a missing attribute to prevent
program_error on an illegal program.
* exp_util.adb (Find_Prim_Op): Rather than Assert (False), raise program
error if primitive is not found, so that exception can be handled
elsewhere on illegal programs.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@138322 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/exp_util.adb')
-rw-r--r-- | gcc/ada/exp_util.adb | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb index d41a6bc383c..e4b4389618b 100644 --- a/gcc/ada/exp_util.adb +++ b/gcc/ada/exp_util.adb @@ -1581,7 +1581,10 @@ package body Exp_Util is or else Etype (First_Entity (Op)) = Etype (Last_Entity (Op))); Next_Elmt (Prim); - pragma Assert (Present (Prim)); + + if No (Prim) then + raise Program_Error; + end if; end loop; return Node (Prim); @@ -1608,7 +1611,10 @@ package body Exp_Util is Prim := First_Elmt (Primitive_Operations (Typ)); while not Is_TSS (Node (Prim), Name) loop Next_Elmt (Prim); - pragma Assert (Present (Prim)); + + if No (Prim) then + raise Program_Error; + end if; end loop; return Node (Prim); |