diff options
Diffstat (limited to 'gcc/ada/a-except-2005.adb')
-rw-r--r-- | gcc/ada/a-except-2005.adb | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/gcc/ada/a-except-2005.adb b/gcc/ada/a-except-2005.adb index 402a04cbe85..14624cb8178 100644 --- a/gcc/ada/a-except-2005.adb +++ b/gcc/ada/a-except-2005.adb @@ -420,11 +420,11 @@ package body Ada.Exceptions is -- Run-Time Check Routines -- ----------------------------- - -- These routines are called from the runtime to raise a specific - -- exception with a reason message attached. The parameters are - -- the file name and line number in each case. The names are keyed - -- to the codes defined in Types.ads and a-types.h (for example, - -- the name Rcheck_05 refers to the Reason whose Pos code is 5). + -- These routines raise a specific exception with a reason message + -- attached. The parameters are the file name and line number in each + -- case. The names are keyed to the codes defined in types.ads and + -- a-types.h (for example, the name Rcheck_05 refers to the Reason + -- RT_Exception_Code'Val (5)). procedure Rcheck_00 (File : System.Address; Line : Integer); procedure Rcheck_01 (File : System.Address; Line : Integer); @@ -838,20 +838,20 @@ package body Ada.Exceptions is (E : Exception_Id; Message : String := "") is + EF : Exception_Id := E; + begin - if E /= null then - Exception_Data.Set_Exception_Msg (E, Message); - Abort_Defer.all; - Raise_Current_Excep (E); + -- Raise CE if E = Null_ID (AI-446) + + if E = null then + EF := Constraint_Error'Identity; end if; - -- Note: if E is null, then we simply return, which is correct Ada 95 - -- semantics. If we are operating in Ada 2005 mode, then the expander - -- generates a raise Constraint_Error immediately following the call - -- to provide the required Ada 2005 semantics (see AI-329). We do it - -- this way to avoid having run time dependencies on the Ada version. + -- Go ahead and raise appropriate exception - return; + Exception_Data.Set_Exception_Msg (EF, Message); + Abort_Defer.all; + Raise_Current_Excep (EF); end Raise_Exception; ---------------------------- |