aboutsummaryrefslogtreecommitdiffstats
path: root/src/synth
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2021-01-01 11:28:48 +0100
committerTristan Gingold <tgingold@free.fr>2021-01-01 14:15:39 +0100
commit1bb3b9066a16a0ace6ac2195f7a500896259fb03 (patch)
tree65d6b8c6b8bc71b7d2b3761377729ed2a670a62a /src/synth
parent7848a0c2280cc0c12954ef37f1fb061a49a2fc5c (diff)
downloadghdl-1bb3b9066a16a0ace6ac2195f7a500896259fb03.tar.gz
ghdl-1bb3b9066a16a0ace6ac2195f7a500896259fb03.tar.bz2
ghdl-1bb3b9066a16a0ace6ac2195f7a500896259fb03.zip
synth-expr: propagate error in synth_indexed_name
Diffstat (limited to 'src/synth')
-rw-r--r--src/synth/netlists-inference.adb1
-rw-r--r--src/synth/synth-expr.adb7
2 files changed, 8 insertions, 0 deletions
diff --git a/src/synth/netlists-inference.adb b/src/synth/netlists-inference.adb
index ecd90bb22..58df1b556 100644
--- a/src/synth/netlists-inference.adb
+++ b/src/synth/netlists-inference.adb
@@ -361,6 +361,7 @@ package body Netlists.Inference is
-- Create the FF.
if Rst = No_Net then
+ -- No async reset
pragma Assert (Rst_Val = No_Net);
if Els = No_Net then
if Init /= No_Net then
diff --git a/src/synth/synth-expr.adb b/src/synth/synth-expr.adb
index 90c4c59b6..4b04060f4 100644
--- a/src/synth/synth-expr.adb
+++ b/src/synth/synth-expr.adb
@@ -1210,6 +1210,13 @@ package body Synth.Expr is
-- Use the base type as the subtype of the index is not synth-ed.
Idx_Val := Synth_Expression_With_Basetype (Syn_Inst, Idx_Expr);
+ if Idx_Val = No_Valtyp then
+ -- Propagate errorc
+ Voff := No_Net;
+ Off := (0, 0);
+ return;
+ end if;
+
Strip_Const (Idx_Val);
Bnd := Get_Array_Bound (Pfx_Type, Dim_Type (I + 1));