diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2010-06-14 10:27:05 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2010-06-14 10:27:05 +0200 |
commit | e074d476c09c72c6e35c904a61caf874afbb567a (patch) | |
tree | ee6e80da2c8b0f47fcfe335443bad67c02958fa3 /gcc/ada/a-convec.adb | |
parent | 8255bc9ded23dd735b703d94855c60f4713310d2 (diff) | |
download | gcc-e074d476c09c72c6e35c904a61caf874afbb567a.zip gcc-e074d476c09c72c6e35c904a61caf874afbb567a.tar.gz gcc-e074d476c09c72c6e35c904a61caf874afbb567a.tar.bz2 |
[multiple changes]
2010-06-14 Robert Dewar <dewar@adacore.com>
* a-convec.adb, sem_prag.adb, checks.adb: Minor reformatting
2010-06-14 Eric Botcazou <ebotcazou@adacore.com>
* init.c: Code clean up.
2010-06-14 Ed Schonberg <schonberg@adacore.com>
* sem_ch13.adb (Analyze_Attribute_Definition_Clause, case Address): Do
not insert address clause in table for later validation if type of
entity is generic, to prevent possible spurious errors.
* sem_ch8.adb: Code clean up.
2010-06-14 Ben Brosgol <brosgol@adacore.com>
* gnat_ugn.texi: Expanded @ovar macro inline to solve problem with
texi2pdf and texi2html.
Document how to change scheduling properties on HP-UX.
2010-06-14 Thomas Quinot <quinot@adacore.com>
* g-socket.ads: Remove misleading comments.
From-SVN: r160711
Diffstat (limited to 'gcc/ada/a-convec.adb')
-rw-r--r-- | gcc/ada/a-convec.adb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/ada/a-convec.adb b/gcc/ada/a-convec.adb index 73151bc..8d146b0 100644 --- a/gcc/ada/a-convec.adb +++ b/gcc/ada/a-convec.adb @@ -103,10 +103,12 @@ package body Ada.Containers.Vectors is -- end of the range of Int. if Index_Type'First <= 0 then + -- Compute the potential Last index value in the normal way, using -- Int as the type in which to perform intermediate -- calculations. Int is a 64-bit type, and Count_Type is a 32-bit -- type, so no overflow can occur. + J := Int (Index_Type'First - 1) + N; if J > Int (Index_Type'Last) then @@ -120,6 +122,7 @@ package body Ada.Containers.Vectors is -- greater than Index_Type'Last (as we do above), we work -- backwards by computing the potential First index value, and -- then checking whether that value is less than Index_Type'First. + J := Int (Index_Type'Last) - N + 1; if J < Int (Index_Type'First) then @@ -129,6 +132,7 @@ package body Ada.Containers.Vectors is -- We have determined that Length would not create a Last index -- value outside of the range of Index_Type, so we can now safely -- compute its value. + J := Int (Index_Type'First - 1) + N; end if; |