diff options
author | Tristan Gingold <tgingold@free.fr> | 2020-04-18 18:59:35 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2020-04-18 19:01:08 +0200 |
commit | 68a0fe9cb77d73a143086c6a424f25980a6c5aa8 (patch) | |
tree | 96f3b32bd03e10ca3d5930040d9f15540387d39e | |
parent | acc1a9f189e1f53489dfe02a86e03277bb23e890 (diff) | |
download | ghdl-68a0fe9cb77d73a143086c6a424f25980a6c5aa8.tar.gz ghdl-68a0fe9cb77d73a143086c6a424f25980a6c5aa8.tar.bz2 ghdl-68a0fe9cb77d73a143086c6a424f25980a6c5aa8.zip |
synth-stmts: propagate errors. For #1243
-rw-r--r-- | src/synth/synth-stmts.adb | 41 |
1 files changed, 23 insertions, 18 deletions
diff --git a/src/synth/synth-stmts.adb b/src/synth/synth-stmts.adb index b624afa28..bfe9f64a1 100644 --- a/src/synth/synth-stmts.adb +++ b/src/synth/synth-stmts.adb @@ -563,27 +563,32 @@ package body Synth.Stmts is while Cwf /= Null_Node loop Val := Synth_Waveform (Syn_Inst, Get_Waveform_Chain (Cwf), Targ.Targ_Type); - V := Get_Net (Val); - Cond := Get_Condition (Cwf); - if Cond /= Null_Node then - Cond_Val := Synth_Expression (Syn_Inst, Cond); - if Cond_Val = No_Valtyp then - Cond_Net := Build_Const_UB32 (Build_Context, 0, 1); - else - Cond_Net := Get_Net (Cond_Val); - end if; + if Val = No_Valtyp then + -- Mark the error, but try to continue. + Set_Error (Syn_Inst); + else + V := Get_Net (Val); + Cond := Get_Condition (Cwf); + if Cond /= Null_Node then + Cond_Val := Synth_Expression (Syn_Inst, Cond); + if Cond_Val = No_Valtyp then + Cond_Net := Build_Const_UB32 (Build_Context, 0, 1); + else + Cond_Net := Get_Net (Cond_Val); + end if; - V := Build_Mux2 (Build_Context, Cond_Net, No_Net, V); - Set_Location (V, Cwf); - end if; + V := Build_Mux2 (Build_Context, Cond_Net, No_Net, V); + Set_Location (V, Cwf); + end if; - if Last /= No_Net then - Inp := Get_Input (Get_Net_Parent (Last), 1); - Connect (Inp, V); - else - First := V; + if Last /= No_Net then + Inp := Get_Input (Get_Net_Parent (Last), 1); + Connect (Inp, V); + else + First := V; + end if; + Last := V; end if; - Last := V; Cwf := Get_Chain (Cwf); end loop; if Cond /= Null_Node then |