~angelsl/ubuntu/wily/gcc-5/mips-cross

« back to all changes in this revision

Viewing changes to debian/patches/ada-749574.diff

  • Committer: angelsl
  • Date: 2015-10-30 03:30:35 UTC
  • Revision ID: angelsl-20151030033035-rmug41zm8hyjgisg
Original import

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
From: Ludovic Brenta <lbrenta@debian.org>
 
2
Forwarded: no
 
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.
 
8
.
 
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.
 
11
.
 
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.
 
16
 
 
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;
 
23
       end if;
 
24
 
 
25
-      return File_Name (Findex1 .. Findex2 - 1);
 
26
+      declare
 
27
+         Result : String (1 .. Findex2 - Findex1);
 
28
+      begin
 
29
+         Result (1 .. Findex2 - Findex1) := File_Name (Findex1 .. Findex2 - 1);
 
30
+         return Result;
 
31
+      end;
 
32
    end Base_Name;
 
33
 
 
34
    -------------------------------