diff options
author | Tristan Gingold <tgingold@free.fr> | 2022-02-26 11:13:26 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2022-02-26 11:13:26 +0100 |
commit | 3a3e2f018466c213ce580289a9b58e3b97198d88 (patch) | |
tree | 1708e2e32650576f290b816cdaa94834e9a5ef1e | |
parent | 480451e09ee965dc9868bfab240743dae32265d4 (diff) | |
download | ghdl-3a3e2f018466c213ce580289a9b58e3b97198d88.tar.gz ghdl-3a3e2f018466c213ce580289a9b58e3b97198d88.tar.bz2 ghdl-3a3e2f018466c213ce580289a9b58e3b97198d88.zip |
trans-chap6.adb: fix minor typing issue
-rw-r--r-- | src/vhdl/translate/trans-chap6.adb | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/vhdl/translate/trans-chap6.adb b/src/vhdl/translate/trans-chap6.adb index 1f4edde79..e9e253126 100644 --- a/src/vhdl/translate/trans-chap6.adb +++ b/src/vhdl/translate/trans-chap6.adb @@ -301,12 +301,21 @@ package body Trans.Chap6 is declare Cond1, Cond2 : O_Enode; Cond : O_Enode; + Lo : O_Cnode; begin - -- FIXME: not correct for enumerations + -- Special case for enumerations + if Get_Kind (Range_Btype) = Iir_Kind_Enumeration_Type_Definition + then + Lo := Chap7.Translate_Static_Range_Left + (Get_Range_Constraint (Range_Btype)); + else + Lo := New_Signed_Literal (Index_Tnode, 0); + end if; + Cond1 := New_Compare_Op (ON_Lt, New_Obj_Value (Off), - New_Lit (New_Signed_Literal (Index_Tnode, 0)), + New_Lit (Lo), Ghdl_Bool_Type); Cond2 := New_Compare_Op |