]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gnatvsn.adb (Gnat_Version_String): Don't overrun Ver_Len_Max.
authorAlexandre Oliva <aoliva@redhat.com>
Fri, 3 Dec 2010 04:48:56 +0000 (04:48 +0000)
committerAlexandre Oliva <aoliva@gcc.gnu.org>
Fri, 3 Dec 2010 04:48:56 +0000 (04:48 +0000)
* gnatvsn.adb (Gnat_Version_String): Don't overrun Ver_Len_Max.
* gnatvsn.ads (Ver_Len_Max): Bump up to 256.
* g-comver.adb (Ver_Len_Max): Likewise.

From-SVN: r167408

gcc/ada/ChangeLog
gcc/ada/g-comver.adb
gcc/ada/gnatvsn.adb
gcc/ada/gnatvsn.ads

index 853926c7e90766f689d63a4a1085cd27dbf11d51..01d219325727cce7e05ab954e81d0d08fca7f230 100644 (file)
@@ -1,3 +1,9 @@
+2010-12-03  Alexandre Oliva  <aoliva@redhat.com>
+
+       * gnatvsn.adb (Gnat_Version_String): Don't overrun Ver_Len_Max.
+       * gnatvsn.ads (Ver_Len_Max): Bump up to 256.
+       * g-comver.adb (Ver_Len_Max): Likewise.
+
 2010-12-03  Laurynas Biveinis  <laurynas.biveinis@gmail.com>
 
        * gcc-interface/decl.c (struct subst_pair_d): Remove GTY tag.
index b71cadcf856d2e70c8a648085d8d1c1a51a3d059..ac096f46397f33fc4163a12a8452c21b7fccfc16 100644 (file)
@@ -37,7 +37,7 @@
 
 package body GNAT.Compiler_Version is
 
-   Ver_Len_Max : constant := 64;
+   Ver_Len_Max : constant := 256;
    --  This is logically a reference to Gnatvsn.Ver_Len_Max but we cannot
    --  import this directly since run-time units cannot WITH compiler units.
 
index 34f72e746fa347551b336236a39215f5e3000bb6..6d76f7e5150bc2efa0ed0a3924b7f7addd1eccf0 100644 (file)
@@ -74,6 +74,8 @@ package body Gnatvsn is
 
          S (Pos + 1) := Version_String (Pos);
          Pos := Pos + 1;
+
+         exit when Pos = Ver_Len_Max;
       end loop;
 
       return S (1 .. Pos);
index 4a3adc86e7a55ad18a498f77265cbd481cde87b6..c73824e5fe60ecedce5f6298a900eaff931804f2 100644 (file)
@@ -70,7 +70,7 @@ package Gnatvsn is
    --  Return the name of the Copyright holder to be displayed by the different
    --  GNAT tools when switch --version is used.
 
-   Ver_Len_Max : constant := 64;
+   Ver_Len_Max : constant := 256;
    --  Longest possible length for Gnat_Version_String in this or any
    --  other version of GNAT. This is used by the binder to establish
    --  space to store any possible version string value for checks. This