aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/i-cpoint.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2015-05-12 10:21:47 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2015-05-12 10:21:47 +0200
commita0a10853345a395b64e44df41dbb743661301ef0 (patch)
tree7758316dfe8e369a2ce9f9e4c5ded52a049019d8 /gcc/ada/i-cpoint.adb
parente23e04db7b649db2d3f575f883385d0aa83aa64f (diff)
downloadgcc-a0a10853345a395b64e44df41dbb743661301ef0.zip
gcc-a0a10853345a395b64e44df41dbb743661301ef0.tar.gz
gcc-a0a10853345a395b64e44df41dbb743661301ef0.tar.bz2
[multiple changes]
2015-05-12 Tristan Gingold <gingold@adacore.com> * i-cpoint.adb (Copy_Terminated_Array): Copy nothing if Length is 0. 2015-05-12 Ed Schonberg <schonberg@adacore.com> * sem_ch3.adb (Complete_Private_Subtype): Propagate Has_Delayed_Aspects flag from private to full view, to ensure that predicate functions are constructed. 2015-05-12 Ed Schonberg <schonberg@adacore.com> * sem_ch6.adb (Process_Formals): If a tagged formal is an incomplete class-wide type, the subprogram must have a delayed freeze even though the opertation is not a primitive of the type. THis ensures that the backend can recover the full view when elaborating the subprogram declaration. 2015-05-12 Ed Schonberg <schonberg@adacore.com> * exp_util.adb (Get_Current_Value_Condition): Nothing to be done if an elsif part has been rewritten so that it is not part of an enclosing if_statement. From-SVN: r223040
Diffstat (limited to 'gcc/ada/i-cpoint.adb')
-rw-r--r--gcc/ada/i-cpoint.adb9
1 files changed, 5 insertions, 4 deletions
diff --git a/gcc/ada/i-cpoint.adb b/gcc/ada/i-cpoint.adb
index 8da412b..ddf33da 100644
--- a/gcc/ada/i-cpoint.adb
+++ b/gcc/ada/i-cpoint.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2014, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2015, Free Software Foundation, Inc. --
-- --
-- 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- --
@@ -151,11 +151,12 @@ package body Interfaces.C.Pointers is
raise Dereference_Error;
end if;
- -- Compute array length (including the terminator)
+ -- Compute array limited length (including the terminator)
- L := 1;
- while S.all /= Terminator and then L < Limit loop
+ L := 0;
+ while L < Limit loop
L := L + 1;
+ exit when S.all = Terminator;
Increment (S);
end loop;