aboutsummaryrefslogtreecommitdiffstats
path: root/src/vhdl/translate
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2019-05-03 19:27:18 +0200
committerTristan Gingold <tgingold@free.fr>2019-05-03 19:27:18 +0200
commit981ccfb0e80e8fffffeed480d311b8c156b640c1 (patch)
treec26467253b197df6215cedcb3a94751e7316dbd0 /src/vhdl/translate
parent9a9881211185a8b66f4d94e66e89d49a567cf6bb (diff)
downloadghdl-981ccfb0e80e8fffffeed480d311b8c156b640c1.tar.gz
ghdl-981ccfb0e80e8fffffeed480d311b8c156b640c1.tar.bz2
ghdl-981ccfb0e80e8fffffeed480d311b8c156b640c1.zip
vhdl: do not crash on 64 bit null range.
Fix #810
Diffstat (limited to 'src/vhdl/translate')
-rw-r--r--src/vhdl/translate/trans-chap3.adb4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/vhdl/translate/trans-chap3.adb b/src/vhdl/translate/trans-chap3.adb
index 7556f2b23..66e897660 100644
--- a/src/vhdl/translate/trans-chap3.adb
+++ b/src/vhdl/translate/trans-chap3.adb
@@ -345,7 +345,9 @@ package body Trans.Chap3 is
Get_Low_High_Limit (Get_Range_Constraint (St), L, H);
Lv := Get_Value (L);
Hv := Get_Value (H);
- if Lv >= -(2 ** 31) and then Hv <= (2 ** 31 - 1) then
+ if Lv in -(2 ** 31) .. 2 ** 31 - 1
+ and then Hv in -(2 ** 31) .. 2 ** 31 - 1
+ then
return Precision_32;
else
if Translation.Flag_Only_32b then