This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] valgrind shows ada/i-cobol.adb real bug


>From the ACATS test, the function should detect the empty
string as invalid and so the internal function Valid_Numeric
should return False.

Tested on x86_64-linux with no regression, ok to commit?

Laurent

2005-01-15  Laurent GUERBY <laurent@guerby.net>

	PR ada/19414
	* i-cobol.adb (Valid_Numeric): Handle zero length case.

Index: i-cobol.adb
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ada/i-cobol.adb,v
retrieving revision 1.6
diff -u -r1.6 i-cobol.adb
--- i-cobol.adb	21 Oct 2003 13:42:08 -0000	1.6
+++ i-cobol.adb	14 Jan 2005 22:00:19 -0000
@@ -632,6 +632,10 @@
       return   Boolean
    is
    begin
+      if Item'Length = 0 then
+         return False;
+      end if;
+
       --  All character positions except first and last must be Digits.
       --  This is true for all the formats.
 



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]