re PR ada/19414 (ACATS cxb4003 - valgrind detects wrong code (invalid read))
authorLaurent GUERBY <laurent@guerby.net>
Wed, 26 Jan 2005 21:35:50 +0000 (21:35 +0000)
committerLaurent Guerby <guerby@gcc.gnu.org>
Wed, 26 Jan 2005 21:35:50 +0000 (21:35 +0000)
2005-01-26  Laurent GUERBY <laurent@guerby.net>

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

From-SVN: r94287

gcc/ada/ChangeLog
gcc/ada/i-cobol.adb

index 815c8b229b3701f3260a45ab54b37b756fc7cfe0..1cf49090e3f2b383a5e1cf8e01b75eb5e94906db 100644 (file)
@@ -1,3 +1,8 @@
+2005-01-26  Laurent GUERBY <laurent@guerby.net>
+
+       PR ada/19414
+       * i-cobol.adb (Valid_Numeric): Handle zero length case.
+       
 2005-01-20  Richard Henderson  <rth@redhat.com>
 
        * Makefile.in (alpha-linux, LIBGNAT_TARGET_PAIRS): Use
index 7dc1f851bed837a97e3d55e786da473ef6bbd092..38de23d8119d2082fe6fcf051de93ca49673b8a4 100644 (file)
@@ -632,6 +632,10 @@ package body Interfaces.COBOL is
       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.