diff options
Diffstat (limited to 'gcc/ada/exp_util.adb')
-rw-r--r-- | gcc/ada/exp_util.adb | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb index d41a6bc383c..09850f644d4 100644 --- a/gcc/ada/exp_util.adb +++ b/gcc/ada/exp_util.adb @@ -1581,7 +1581,12 @@ package body Exp_Util is or else Etype (First_Entity (Op)) = Etype (Last_Entity (Op))); Next_Elmt (Prim); - pragma Assert (Present (Prim)); + + -- Raise Program_Error if no primitive found + + if No (Prim) then + raise Program_Error; + end if; end loop; return Node (Prim); @@ -1608,7 +1613,12 @@ 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)); + + -- Raise program error if no primitive found + + if No (Prim) then + raise Program_Error; + end if; end loop; return Node (Prim); |