diff options
-rw-r--r-- | src/synth/synth-expr.adb | 6 | ||||
-rw-r--r-- | src/synth/synth-static_oper.adb | 2 | ||||
-rw-r--r-- | src/synth/synth-stmts.adb | 4 |
3 files changed, 11 insertions, 1 deletions
diff --git a/src/synth/synth-expr.adb b/src/synth/synth-expr.adb index eb0357145..ecb5f199b 100644 --- a/src/synth/synth-expr.adb +++ b/src/synth/synth-expr.adb @@ -1780,12 +1780,18 @@ package body Synth.Expr is end case; Left := Synth_Expression_With_Type (Syn_Inst, Left_Expr, Typ); + if Left = null then + return null; + end if; if Is_Static_Val (Left) and then Get_Static_Discrete (Left) = Val then return Create_Value_Discrete (Val, Boolean_Type); end if; Strip_Const (Left); Right := Synth_Expression_With_Type (Syn_Inst, Right_Expr, Typ); + if Right = null then + return null; + end if; Strip_Const (Right); -- Return a static value if both operands are static. diff --git a/src/synth/synth-static_oper.adb b/src/synth/synth-static_oper.adb index 511c72626..cb6fd0877 100644 --- a/src/synth/synth-static_oper.adb +++ b/src/synth/synth-static_oper.adb @@ -595,7 +595,7 @@ package body Synth.Static_Oper is Error_Msg_Synth (+Expr, "synth_static_dyadic_predefined: unhandled " & Iir_Predefined_Functions'Image (Def)); - raise Internal_Error; + return null; end case; end Synth_Static_Dyadic_Predefined; diff --git a/src/synth/synth-stmts.adb b/src/synth/synth-stmts.adb index d7fe43c78..c40eaadc6 100644 --- a/src/synth/synth-stmts.adb +++ b/src/synth/synth-stmts.adb @@ -680,6 +680,10 @@ package body Synth.Stmts is Phi_False : Phi_Type; begin Cond_Val := Synth_Expression (C.Inst, Cond); + if Cond_Val = null then + Set_Error (C.Inst); + return; + end if; if Is_Static (Cond_Val) then Strip_Const (Cond_Val); if Cond_Val.Scal = 1 then |