aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2020-03-14 09:23:00 +0100
committerTristan Gingold <tgingold@free.fr>2020-03-14 09:25:39 +0100
commit6c6852b5864ecfb41f03650277ed9dac397d6f2b (patch)
tree4e9f87deda8e06cc8ba35ea0b457a175d108ea08
parentc4baaa1a0419517aad50e43893c8400af4e2b7a0 (diff)
downloadghdl-6c6852b5864ecfb41f03650277ed9dac397d6f2b.tar.gz
ghdl-6c6852b5864ecfb41f03650277ed9dac397d6f2b.tar.bz2
ghdl-6c6852b5864ecfb41f03650277ed9dac397d6f2b.zip
synth: propagate more errors.
-rw-r--r--src/synth/synth-decls.adb4
-rw-r--r--src/synth/synth-stmts.adb4
2 files changed, 8 insertions, 0 deletions
diff --git a/src/synth/synth-decls.adb b/src/synth/synth-decls.adb
index f0c885d0c..88a61d89b 100644
--- a/src/synth/synth-decls.adb
+++ b/src/synth/synth-decls.adb
@@ -491,6 +491,10 @@ package body Synth.Decls is
Obj_Type := Get_Value_Type (Syn_Inst, Decl_Type);
Val := Synth_Expression_With_Type
(Syn_Inst, Get_Default_Value (Decl), Obj_Type);
+ if Val = null then
+ Set_Error (Syn_Inst);
+ return;
+ end if;
Val := Synth_Subtype_Conversion (Val, Obj_Type, True, Decl);
-- For constant functions, the value must be constant.
pragma Assert (not Get_Instance_Const (Syn_Inst)
diff --git a/src/synth/synth-stmts.adb b/src/synth/synth-stmts.adb
index f99a3f0ec..a5304a040 100644
--- a/src/synth/synth-stmts.adb
+++ b/src/synth/synth-stmts.adb
@@ -2649,6 +2649,10 @@ package body Synth.Stmts is
Inst : Instance;
begin
Val := Synth_Expression (Syn_Inst, Cond);
+ if Val = null then
+ Set_Error (Syn_Inst);
+ return;
+ end if;
if Is_Static (Val) then
if Val.Scal /= 1 then
Error_Msg_Synth (+Stmt, "assertion failure");