From: aoliva Date: Fri, 3 Dec 2010 04:48:56 +0000 (+0000) Subject: * gnatvsn.adb (Gnat_Version_String): Don't overrun Ver_Len_Max. X-Git-Tag: upstream/4.9.2~24411 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f3f03d1ef01ae945da02a8d1fc3972459b1df5c3;p=platform%2Fupstream%2Flinaro-gcc.git * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@167408 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 853926c..01d2193 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,9 @@ +2010-12-03 Alexandre Oliva + + * 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 * gcc-interface/decl.c (struct subst_pair_d): Remove GTY tag. diff --git a/gcc/ada/g-comver.adb b/gcc/ada/g-comver.adb index b71cadc..ac096f4 100644 --- a/gcc/ada/g-comver.adb +++ b/gcc/ada/g-comver.adb @@ -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. diff --git a/gcc/ada/gnatvsn.adb b/gcc/ada/gnatvsn.adb index 34f72e7..6d76f7e 100644 --- a/gcc/ada/gnatvsn.adb +++ b/gcc/ada/gnatvsn.adb @@ -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); diff --git a/gcc/ada/gnatvsn.ads b/gcc/ada/gnatvsn.ads index 4a3adc8..c73824e 100644 --- a/gcc/ada/gnatvsn.ads +++ b/gcc/ada/gnatvsn.ads @@ -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