aboutsummaryrefslogtreecommitdiffstats
path: root/src/synth
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2022-10-01 18:30:41 +0200
committerTristan Gingold <tgingold@free.fr>2022-10-01 18:30:41 +0200
commitd7c93e9d72f8ddb29446d525c430098f61e8f9b3 (patch)
treed1e8917cfea926e93d9affab8166621e8b84dbce /src/synth
parent8ac45f50fa908c6498801933b67d949f3f0923ca (diff)
downloadghdl-d7c93e9d72f8ddb29446d525c430098f61e8f9b3.tar.gz
ghdl-d7c93e9d72f8ddb29446d525c430098f61e8f9b3.tar.bz2
ghdl-d7c93e9d72f8ddb29446d525c430098f61e8f9b3.zip
synth: avoid on crash on overflow in ranges
Diffstat (limited to 'src/synth')
-rw-r--r--src/synth/elab-vhdl_types.adb8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/synth/elab-vhdl_types.adb b/src/synth/elab-vhdl_types.adb
index b92c78452..81ab20268 100644
--- a/src/synth/elab-vhdl_types.adb
+++ b/src/synth/elab-vhdl_types.adb
@@ -42,6 +42,14 @@ package body Elab.Vhdl_Types is
-- Static values.
L := Synth_Expression_With_Basetype (Syn_Inst, Get_Left_Limit (Rng));
R := Synth_Expression_With_Basetype (Syn_Inst, Get_Right_Limit (Rng));
+ if L = No_Valtyp or else R = No_Valtyp then
+ Set_Error (Syn_Inst);
+ return (Dir => Get_Direction (Rng),
+ Left => 0,
+ Right => 0,
+ Is_Signed => False);
+ end if;
+
Strip_Const (L);
Strip_Const (R);