aboutsummaryrefslogtreecommitdiffstats
path: root/src/synth
diff options
context:
space:
mode:
Diffstat (limited to 'src/synth')
-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");