Package: ghdl
Version: 0.29+gcc4.3.4+dfsg-1
Severity: minor
Tags: patch

--- Please enter the report below this line. ---

Hi

I found that launching "ghdl -s dir", "ghdl -a dir" or "ghdl -i dir" (where dir 
is a directory)
make ghdl crash instead of putting an error message telling that "dir" isn't a 
valid file.

Here is the error message :

jo...@pc:~/test$ /usr/bin/ghdl -s dir

******************** GHDL Bug occured ****************************
Please report this bug on http://gna.org/projects/ghdl
GHDL release: GHDL 0.29 (20100109) [Sokcho edition]
Compiled with GNAT Version: 4.4.3
In directory: /home/Jonas/test/
Command line:
/usr/lib/ghdl/bin/ghdl -s dir
Exception TYPES.INTERNAL_ERROR raised
Exception information:
Exception name: TYPES.INTERNAL_ERROR
Message: files_map.adb:779
Call stack traceback locations:
0x80a1353 0x808f7af 0x8086f7b 0x80870a8 0x80a8af3 0x805cd08 0x804caa5 0xb73eeb53
******************************************************************
jo...@pc:~/test$

I also put a small patch in attachement that solve the problem.

Bye
Jonas

--- System information. ---
Architecture: i386
Kernel:       Linux 2.6.32-trunk-686

Debian Release: squeeze/sid
  992 testing         ftp.ch.debian.org 
  991 unstable        ftp.ch.debian.org 
   80 experimental    ftp.ch.debian.org 
  500 oldstable       ftp.ch.debian.org 

--- Package information. ---
Depends             (Version) | Installed
=============================-+-=============
libc6                (>= 2.7) | 2.10.2-6
libgcc1          (>= 1:4.1.1) | 1:4.4.3-3
libgmp3c2                     | 2:4.3.2+dfsg-1
libgnat-4.4      (>= 4.4.3-1) | 4.4.3-1
libmpfr1ldbl                  | 2.4.2-3
gnat-4.4                      | 4.4.3-1
zlib1g-dev                    | 1:1.2.3.4.dfsg-3


Recommends      (Version) | Installed
=========================-+-===========
gtkwave                   | 3.3.3-1


Package's Suggests field is empty.
diff -rupN ghdl_orig//vhdl/files_map.adb ghdl/vhdl/files_map.adb
--- ghdl_orig//vhdl/files_map.adb	2010-01-25 00:04:30.000000000 +0100
+++ ghdl/vhdl/files_map.adb	2010-03-14 18:49:37.832710913 +0100
@@ -757,6 +757,9 @@ package body Files_Map is
       declare
          Filename : String := Get_Pathname (Directory, Name, True);
       begin
+         if not Is_Regular_File(Filename'Address) then
+            return No_Source_File_Entry;
+         end if;
          Fd := Open_Read (Filename'Address, Binary);
          if Fd = Invalid_FD then
             return No_Source_File_Entry;

Reply via email to