diff options
author | Tristan Gingold <tgingold@free.fr> | 2023-01-11 07:00:08 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2023-01-11 07:00:08 +0100 |
commit | 467acc26b864bd0d4e531b1095cef067ba83cf3b (patch) | |
tree | ceefcf42c55f241033cb166dfd5a235c8cf5ec84 /src/synth | |
parent | 57ae0c0644abeab372644b7d274a9fee3cea3499 (diff) | |
download | ghdl-467acc26b864bd0d4e531b1095cef067ba83cf3b.tar.gz ghdl-467acc26b864bd0d4e531b1095cef067ba83cf3b.tar.bz2 ghdl-467acc26b864bd0d4e531b1095cef067ba83cf3b.zip |
synth: avoid a crash on very large object types
Diffstat (limited to 'src/synth')
-rw-r--r-- | src/synth/elab-vhdl_objtypes.adb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/synth/elab-vhdl_objtypes.adb b/src/synth/elab-vhdl_objtypes.adb index ebde9f28b..37c53c7f5 100644 --- a/src/synth/elab-vhdl_objtypes.adb +++ b/src/synth/elab-vhdl_objtypes.adb @@ -569,6 +569,9 @@ package body Elab.Vhdl_Objtypes is end case; if Len < 0 then return 0; + elsif Len > Int64 (Uns32'Last) then + -- Truncate very large lengths, such objects should not exist. + return Uns32'Last; else return Uns32 (Len); end if; |