summaryrefslogtreecommitdiff
path: root/gcc/ada/g-os_lib.adb
diff options
context:
space:
mode:
authorEd Schonberg <schonber@gnat.com>2001-11-29 05:15:53 +0000
committerGeert Bosch <bosch@gcc.gnu.org>2001-11-29 06:15:53 +0100
commit9f63939774d1b9eaf9c4196ac50f9e83ddbae822 (patch)
tree89530c18f3ddfe06f8c17ed0a9a81ed0f17cbd30 /gcc/ada/g-os_lib.adb
parent911b415e5242af7ee14f8261482cf0d45fa78b4d (diff)
downloadgcc-9f63939774d1b9eaf9c4196ac50f9e83ddbae822.tar.gz
g-os_lib.adb (Add_To_Command): use explicit loop to move string into Command, an array conversion is illegal here.
* g-os_lib.adb (Add_To_Command): use explicit loop to move string into Command, an array conversion is illegal here. Uncovered by ACATS B460005. From-SVN: r47435
Diffstat (limited to 'gcc/ada/g-os_lib.adb')
-rw-r--r--gcc/ada/g-os_lib.adb8
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/ada/g-os_lib.adb b/gcc/ada/g-os_lib.adb
index cc600789e1d..3c352366acb 100644
--- a/gcc/ada/g-os_lib.adb
+++ b/gcc/ada/g-os_lib.adb
@@ -1316,7 +1316,13 @@ package body GNAT.OS_Lib is
begin
Command_Last := Command_Last + S'Length;
- Command (First .. Command_Last) := Chars (S);
+
+ -- Move characters one at a time, because Command has
+ -- aliased components.
+
+ for J in S'Range loop
+ Command (First + J - S'First) := S (J);
+ end loop;
Command_Last := Command_Last + 1;
Command (Command_Last) := ASCII.NUL;