diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2015-05-12 10:07:41 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2015-05-12 10:07:41 +0200 |
commit | 84dad5564e15efedd6e41950ae856ec3bb201052 (patch) | |
tree | af5dd7a0f9fa835673c73dc8855af294c3d07fb5 /gcc/ada/a-reatim.adb | |
parent | ddbc55d8adbf50089321fc531dc047630958b185 (diff) | |
download | gcc-84dad5564e15efedd6e41950ae856ec3bb201052.zip gcc-84dad5564e15efedd6e41950ae856ec3bb201052.tar.gz gcc-84dad5564e15efedd6e41950ae856ec3bb201052.tar.bz2 |
[multiple changes]
2015-05-12 Robert Dewar <dewar@adacore.com>
* exp_unst.adb (Get_Real_Subp): New subprogram.
(Unnest_Subprogram): Use Get_Real_Subp.
(Uplev_Refs_For_One_Subp): Skip if no ARECnU entity.
(Uplev_Refs_For_One_Subp): Use actual subtype in unconstrained case.
2015-05-12 Robert Dewar <dewar@adacore.com>
* a-reatim.adb ("/"): Add explicit check for Time_Span_First / -1.
2015-05-12 Ed Schonberg <schonberg@adacore.com>
* sem_ch4.adb (Extended_Primitive_Ops): New subprogram,
auxiliary to Try_Primitive_Operation to handle properly prefixed
calls where the operation is not a primitive of the type, but
is declared in the package body that is in the immediate scope
of the type.
From-SVN: r223036
Diffstat (limited to 'gcc/ada/a-reatim.adb')
-rw-r--r-- | gcc/ada/a-reatim.adb | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/gcc/ada/a-reatim.adb b/gcc/ada/a-reatim.adb index 4597dc3..52aa9f3 100644 --- a/gcc/ada/a-reatim.adb +++ b/gcc/ada/a-reatim.adb @@ -7,7 +7,7 @@ -- B o d y -- -- -- -- Copyright (C) 1991-1994, Florida State University -- --- Copyright (C) 1995-2014, AdaCore -- +-- Copyright (C) 1995-2015, AdaCore -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -123,6 +123,16 @@ package body Ada.Real_Time is pragma Unsuppress (Overflow_Check); pragma Unsuppress (Division_Check); begin + -- Even though checks are unsuppressed, we need an explicit check for + -- the case of largest negative integer divided by minus one, since + -- some library routines we use fail to catch this case. This will be + -- fixed at the compiler level in the future, at which point this test + -- can be removed. + + if Left = Time_Span_First and then Right = -1 then + raise Constraint_Error with "overflow"; + end if; + return Time_Span (Duration (Left) / Right); end "/"; |