summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgingold2010-02-26 05:46:58 +0000
committergingold2010-02-26 05:46:58 +0000
commit926b893b005c0dbade106f04f9e2dddb781e8ec1 (patch)
treef1d0e185b29fbd83dd74d7d32764563b23dcea52
parenta0f20fb14ae0e842a34b3255c067e58ee8bd9587 (diff)
downloadghdl-926b893b005c0dbade106f04f9e2dddb781e8ec1.tar.gz
ghdl-926b893b005c0dbade106f04f9e2dddb781e8ec1.tar.bz2
ghdl-926b893b005c0dbade106f04f9e2dddb781e8ec1.zip
Handle overflow in physical expression.
-rw-r--r--evaluation.adb8
1 files changed, 7 insertions, 1 deletions
diff --git a/evaluation.adb b/evaluation.adb
index 571dcad..07cc313 100644
--- a/evaluation.adb
+++ b/evaluation.adb
@@ -24,7 +24,9 @@ with Flags; use Flags;
with Std_Names;
package body Evaluation is
- function Get_Physical_Value (Expr : Iir) return Iir_Int64 is
+ function Get_Physical_Value (Expr : Iir) return Iir_Int64
+ is
+ pragma Unsuppress (Overflow_Check);
begin
case Get_Kind (Expr) is
when Iir_Kind_Physical_Int_Literal =>
@@ -35,6 +37,10 @@ package body Evaluation is
when others =>
Error_Kind ("get_physical_value", Expr);
end case;
+ exception
+ when Constraint_Error =>
+ Error_Msg_Sem ("arithmetic overflow in physical expression", Expr);
+ return Get_Value (Expr);
end Get_Physical_Value;
function Build_Integer (Val : Iir_Int64; Origin : Iir)