aboutsummaryrefslogtreecommitdiffstats
path: root/translate/translation.adb
diff options
context:
space:
mode:
authorBrian Drummond <brian@shapes.demon.co.uk>2013-12-02 16:59:06 +0000
committerBrian Drummond <brian@shapes.demon.co.uk>2013-12-02 16:59:06 +0000
commit0161db14ee47b9d3e631cf58c02aad30f728aea4 (patch)
treedb6ec5f337e857b9de1be3fc2cb448dbcffdf1ff /translate/translation.adb
parent3cfd999c339e5c5f7b8ab814aa0d379329a22190 (diff)
downloadghdl-0161db14ee47b9d3e631cf58c02aad30f728aea4.tar.gz
ghdl-0161db14ee47b9d3e631cf58c02aad30f728aea4.tar.bz2
ghdl-0161db14ee47b9d3e631cf58c02aad30f728aea4.zip
Patch for Support #3028 - range of 32 bit integer exceeded
Diffstat (limited to 'translate/translation.adb')
-rw-r--r--translate/translation.adb12
1 files changed, 11 insertions, 1 deletions
diff --git a/translate/translation.adb b/translate/translation.adb
index b2294bbc6..24bd3853c 100644
--- a/translate/translation.adb
+++ b/translate/translation.adb
@@ -7277,6 +7277,16 @@ package body Translation is
Def : Iir;
Mode : Type_Mode_Type) return Boolean
is
+
+ function Get_Value_I32 (Lit : Iir) return Iir_Int32 is
+ begin
+ return Iir_Int32(Get_Value(Lit));
+ exception
+ when Constraint_Error =>
+ Error_Msg_Sem ("Value exceeds range of 32-bit Integer" , Lit);
+ return Iir_Int32(0);
+ end Get_Value_I32;
+
begin
case Mode is
when Type_Mode_B2 =>
@@ -7309,7 +7319,7 @@ package body Translation is
declare
V : Iir_Int32;
begin
- V := Iir_Int32 (Get_Value (Lit));
+ V := Get_Value_I32 (Lit);
if Is_Hi then
return V = Iir_Int32'Last;
else