diff options
author | Tristan Gingold <tgingold@free.fr> | 2021-03-13 07:47:47 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2021-03-13 08:01:45 +0100 |
commit | 301c417faec48049ab3ffe208bdbbc6098f482ad (patch) | |
tree | 6bb4ea980db61d3c7b4a3f9528315ee1ea01428d /src/synth/synth-decls.adb | |
parent | 29db6e5c0f8ed313315f83f5cf0ccfafc9ea00b3 (diff) | |
download | ghdl-301c417faec48049ab3ffe208bdbbc6098f482ad.tar.gz ghdl-301c417faec48049ab3ffe208bdbbc6098f482ad.tar.bz2 ghdl-301c417faec48049ab3ffe208bdbbc6098f482ad.zip |
synth: handle attributes of length 0. Fix #1680
Diffstat (limited to 'src/synth/synth-decls.adb')
-rw-r--r-- | src/synth/synth-decls.adb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/synth/synth-decls.adb b/src/synth/synth-decls.adb index f1835e5b9..d3a903b00 100644 --- a/src/synth/synth-decls.adb +++ b/src/synth/synth-decls.adb @@ -93,12 +93,15 @@ package body Synth.Decls is function Memtyp_To_Pval (Mt : Memtyp) return Pval is Len : constant Uns32 := (Mt.Typ.W + 31) / 32; - pragma Assert (Len > 0); Vec : Logvec_Array_Acc; Off : Uns32; Has_Zx : Boolean; Pv : Pval; begin + if Len = 0 then + return Create_Pval2 (0); + end if; + Vec := new Logvec_Array'(0 .. Digit_Index (Len - 1) => (0, 0)); Off := 0; Has_Zx := False; |