From 40038500737a24b00bfe95ddad1057e2bcad4002 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Thu, 2 Jul 2020 18:44:05 +0200 Subject: vhdl-evaluation: fix for array index. For #1387 --- src/vhdl/vhdl-evaluation.adb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/vhdl/vhdl-evaluation.adb') diff --git a/src/vhdl/vhdl-evaluation.adb b/src/vhdl/vhdl-evaluation.adb index 5f6ad409e..d21288136 100644 --- a/src/vhdl/vhdl-evaluation.adb +++ b/src/vhdl/vhdl-evaluation.adb @@ -2590,7 +2590,13 @@ package body Vhdl.Evaluation is when Iir_Kind_Choice_By_Expression => exit when Eval_Is_Eq (Get_Choice_Expression (Assoc), Idx); when Iir_Kind_Choice_By_Range => - exit when Eval_Is_In_Bound (Idx, Get_Choice_Range (Assoc)); + declare + Rng : Iir; + begin + Rng := Get_Choice_Range (Assoc); + Rng := Eval_Static_Range (Rng); + exit when Eval_Int_In_Range (Eval_Pos (Idx), Rng); + end; when Iir_Kind_Choice_By_Others => exit; when others => -- cgit v1.2.3