diff options
Diffstat (limited to 'src/synth/synth-decls.adb')
-rw-r--r-- | src/synth/synth-decls.adb | 4 |
1 files changed, 4 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) |