aboutsummaryrefslogtreecommitdiffstats
path: root/src/synth/synth-expr.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2020-06-19 06:28:16 +0200
committerTristan Gingold <tgingold@free.fr>2020-06-19 06:28:16 +0200
commit8ea10774e2643e653dc6b5a07a6abd43fd01055d (patch)
treeafbe4982e1515e64ce0e8ca3a276d8f538cace08 /src/synth/synth-expr.adb
parent5c4dd6ea37990668c5cd29713a91d462943d89c2 (diff)
downloadghdl-8ea10774e2643e653dc6b5a07a6abd43fd01055d.tar.gz
ghdl-8ea10774e2643e653dc6b5a07a6abd43fd01055d.tar.bz2
ghdl-8ea10774e2643e653dc6b5a07a6abd43fd01055d.zip
synth: avoid crash on invalid range. For ghdl/ghdl-yosys-plugin#126
Diffstat (limited to 'src/synth/synth-expr.adb')
-rw-r--r--src/synth/synth-expr.adb6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/synth/synth-expr.adb b/src/synth/synth-expr.adb
index 71a9f7e70..85404d7e3 100644
--- a/src/synth/synth-expr.adb
+++ b/src/synth/synth-expr.adb
@@ -445,7 +445,11 @@ package body Synth.Expr is
if not (Is_Static (L.Val) and Is_Static (R.Val)) then
Error_Msg_Synth (+Rng, "limits of range are not constant");
- raise Internal_Error;
+ Set_Error (Syn_Inst);
+ return (Dir => Get_Direction (Rng),
+ Left => 0,
+ Right => 0,
+ Is_Signed => False);
end if;
Lval := Read_Discrete (L);