1
From: Ludovic Brenta <lbrenta@debian.org>
3
Bug-Debian: http://bugs.debian.org/749574
4
Description: Constraint_Error, range check failed at gnatlink.adb:2195, when called from gnatmake with -D option
5
The procedure gnatlink assumes that the Linker_Options.Table contains access
6
values to strings whose 'First index is always 1. This assumption is wrong
7
for the string returned by function Base_Name.
9
Instead of fixing the assumption in many places, this patch changes the
10
function Base_Name always to return a string with 'First=1.
12
This looks like an upstream bug but strangely the reporter of this bug
13
says it does not happen on GCC built from upstream sources. Further
14
investigation is required to determine whether or not to forward this
15
bug and patch upstream.
17
Index: b/src/gcc/ada/gnatlink.adb
18
===================================================================
19
--- a/src/gcc/ada/gnatlink.adb
20
+++ b/src/gcc/ada/gnatlink.adb
21
@@ -266,7 +266,12 @@ procedure Gnatlink is
22
Findex2 := File_Name'Last + 1;
25
- return File_Name (Findex1 .. Findex2 - 1);
27
+ Result : String (1 .. Findex2 - Findex1);
29
+ Result (1 .. Findex2 - Findex1) := File_Name (Findex1 .. Findex2 - 1);
34
-------------------------------