diff options
author | Tristan Gingold <tgingold@free.fr> | 2020-07-02 18:44:05 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2020-07-02 18:44:05 +0200 |
commit | 40038500737a24b00bfe95ddad1057e2bcad4002 (patch) | |
tree | 6700edd6998ff968961166cfdf84a4ac70fa93d4 /src | |
parent | acb6ffa4ea1eae70e3d9877cc485bb3fb82e3ea5 (diff) | |
download | ghdl-40038500737a24b00bfe95ddad1057e2bcad4002.tar.gz ghdl-40038500737a24b00bfe95ddad1057e2bcad4002.tar.bz2 ghdl-40038500737a24b00bfe95ddad1057e2bcad4002.zip |
vhdl-evaluation: fix for array index. For #1387
Diffstat (limited to 'src')
-rw-r--r-- | src/vhdl/vhdl-evaluation.adb | 8 |
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 => |