aboutsummaryrefslogtreecommitdiffstats
path: root/src/vhdl/vhdl-evaluation.adb
diff options
context:
space:
mode:
Diffstat (limited to 'src/vhdl/vhdl-evaluation.adb')
-rw-r--r--src/vhdl/vhdl-evaluation.adb5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/vhdl/vhdl-evaluation.adb b/src/vhdl/vhdl-evaluation.adb
index e20952634..53c82abf9 100644
--- a/src/vhdl/vhdl-evaluation.adb
+++ b/src/vhdl/vhdl-evaluation.adb
@@ -3279,15 +3279,16 @@ package body Vhdl.Evaluation is
is
Selected_El : constant Iir := Get_Named_Entity (Expr);
El_Pos : constant Iir_Index32 := Get_Element_Position (Selected_El);
+ Expr_Prefix : constant Iir := Get_Prefix (Expr);
Prefix : Iir;
Cur_Pos : Iir_Index32;
Assoc : Iir;
Assoc_Expr : Iir;
Res : Iir;
begin
- Prefix := Get_Prefix (Expr);
- Prefix := Eval_Static_Expr (Prefix);
+ Prefix := Eval_Static_Expr (Expr_Prefix);
if Is_Overflow_Literal (Prefix) then
+ Free_Eval_Static_Expr (Prefix, Expr_Prefix);
return Build_Overflow (Expr, Get_Type (Expr));
end if;