diff options
-rw-r--r-- | src/grt/ghwlib.c | 2 | ||||
-rw-r--r-- | testsuite/gna/issue1326/mytestbench.vhdl | 17 | ||||
-rwxr-xr-x | testsuite/gna/issue1326/testsuite.sh | 18 |
3 files changed, 36 insertions, 1 deletions
diff --git a/src/grt/ghwlib.c b/src/grt/ghwlib.c index 0e3a07568..8d1fd8ddf 100644 --- a/src/grt/ghwlib.c +++ b/src/grt/ghwlib.c @@ -1313,7 +1313,7 @@ ghw_disp_hie (struct ghw_handler *h, struct ghw_hie *top) ghw_disp_subtype_indication (h, hie->u.sig.type); printf (":"); k = 0; - assert (sigs[0] != GHW_NO_SIG); + while (1) { /* First signal of the range. */ diff --git a/testsuite/gna/issue1326/mytestbench.vhdl b/testsuite/gna/issue1326/mytestbench.vhdl new file mode 100644 index 000000000..3dbda0d6d --- /dev/null +++ b/testsuite/gna/issue1326/mytestbench.vhdl @@ -0,0 +1,17 @@ +library ieee ; + +entity mytestbench is +end mytestbench; + +architecture arch of mytestbench is + signal zero_length_array : bit_vector(-1 downto 0); +begin + + -- Just here so we get a meaningful dump. + main_process: process + begin + wait for 10 ns; + wait; + end process; + +end arch; diff --git a/testsuite/gna/issue1326/testsuite.sh b/testsuite/gna/issue1326/testsuite.sh new file mode 100755 index 000000000..e6b3262c8 --- /dev/null +++ b/testsuite/gna/issue1326/testsuite.sh @@ -0,0 +1,18 @@ +#! /bin/sh + +. ../../testenv.sh + +analyze mytestbench.vhdl +elab mytestbench + +simulate mytestbench --wave=dump.ghw | tee mytestbench.out + +gcc ../../../src/grt/ghwdump.c ../../../src/grt/ghwlib.c -I../../../src/grt/ -o ghwdump + +# We're just checking that ghwdump doesn't crash on a zero length signal. +./ghwdump -ths dump.ghw > dump.txt + +rm -f mytestbench.out ghwdump dump.txt dump.ghw +clean + +echo "Test passed" |