diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/vhdl/sem_expr.adb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/vhdl/sem_expr.adb b/src/vhdl/sem_expr.adb index 474980c..bef2c73 100644 --- a/src/vhdl/sem_expr.adb +++ b/src/vhdl/sem_expr.adb @@ -2725,9 +2725,8 @@ package body Sem_Expr is Pos_Max : Iir_Int64; E_Pos : Iir_Int64; - Bt : Iir; + Bt : constant Iir := Get_Base_Type (Sub_Type); begin - Bt := Get_Base_Type (Sub_Type); if not Is_Sub_Range and then Get_Type_Staticness (Sub_Type) = Locally and then Type_Has_Bounds @@ -2737,6 +2736,11 @@ package body Sem_Expr is Lb := Low; Hb := High; end if; + if Lb = Null_Iir or else Hb = Null_Iir then + -- Return now in case of error. + Free (Arr); + return; + end if; -- Checks all values between POS and POS_MAX are handled. Pos := Eval_Pos (Lb); Pos_Max := Eval_Pos (Hb); |