aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/a-strsea.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2014-10-17 10:51:08 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2014-10-17 10:51:08 +0200
commitdc06dd83660010f2ed70c6205a0876f91553a30e (patch)
treea75ab030ca6b5b8bdc2aa7d89f9ea76eb33d3698 /gcc/ada/a-strsea.adb
parentc3ed5e9eaf279c24b3fb69bf261f4abef67aad04 (diff)
downloadgcc-dc06dd83660010f2ed70c6205a0876f91553a30e.zip
gcc-dc06dd83660010f2ed70c6205a0876f91553a30e.tar.gz
gcc-dc06dd83660010f2ed70c6205a0876f91553a30e.tar.bz2
[multiple changes]
2014-10-17 Ed Schonberg <schonberg@adacore.com> * sem_ch13.adb (Add_Invariants): For a class-wide type invariant, preserve semantic information on the invariant expression (typically a function call) because it may be inherited by a type extension in a different unit, and it cannot be resolved by visibility elsewhere because it may refer to local entities. 2014-10-17 Robert Dewar <dewar@adacore.com> * gnat_rm.texi: Document that string literal can be used for pragma Warnings when operating in Ada 83 mode. 2014-10-17 Ed Schonberg <schonberg@adacore.com> * freeze.adb (Find_Aggregate_Component_Desig_Type): New subsidiary function to Freeze_ Expression, used to determine whether an aggregate for an array of access types also freezes the designated type, when some aggregate components are allocators. 2014-10-17 Ed Schonberg <schonberg@adacore.com> * a-strsea.adb (Find_Token): AI05-031 indicates that the procedure must raise Index_Error when Source is not empty and the From parameter is not within the range of the Source string. 2014-10-17 Robert Dewar <dewar@adacore.com> * sem_prag.adb (Is_Static_String_Expression): Allow string literal in Ada 83 mode. From-SVN: r216377
Diffstat (limited to 'gcc/ada/a-strsea.adb')
-rw-r--r--gcc/ada/a-strsea.adb6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/ada/a-strsea.adb b/gcc/ada/a-strsea.adb
index 82acd1a..f1fb352 100644
--- a/gcc/ada/a-strsea.adb
+++ b/gcc/ada/a-strsea.adb
@@ -203,6 +203,12 @@ package body Ada.Strings.Search is
Last : out Natural)
is
begin
+ -- AI05-031: Raise Index error if Source non-empty and From not in range
+
+ if Source'Length /= 0 and then From not in Source'Range then
+ raise Index_Error;
+ end if;
+
for J in From .. Source'Last loop
if Belongs (Source (J), Set, Test) then
First := J;