aboutsummaryrefslogtreecommitdiffstats
path: root/src/vhdl/vhdl-evaluation.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2020-07-02 18:44:05 +0200
committerTristan Gingold <tgingold@free.fr>2020-07-02 18:44:05 +0200
commit40038500737a24b00bfe95ddad1057e2bcad4002 (patch)
tree6700edd6998ff968961166cfdf84a4ac70fa93d4 /src/vhdl/vhdl-evaluation.adb
parentacb6ffa4ea1eae70e3d9877cc485bb3fb82e3ea5 (diff)
downloadghdl-40038500737a24b00bfe95ddad1057e2bcad4002.tar.gz
ghdl-40038500737a24b00bfe95ddad1057e2bcad4002.tar.bz2
ghdl-40038500737a24b00bfe95ddad1057e2bcad4002.zip
vhdl-evaluation: fix for array index. For #1387
Diffstat (limited to 'src/vhdl/vhdl-evaluation.adb')
-rw-r--r--src/vhdl/vhdl-evaluation.adb8
1 files changed, 7 insertions, 1 deletions
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 =>