diff options
author | Tristan Gingold <tgingold@free.fr> | 2022-06-26 07:21:28 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2022-06-26 07:21:28 +0200 |
commit | 2e56e2424514b788258f0490af65e316e26715bf (patch) | |
tree | 60096bc58885748ca7c2d12da7869eed022bcb84 | |
parent | 73c3617f8e6ca9ef251ed1c4471c68608d70b827 (diff) | |
download | ghdl-2e56e2424514b788258f0490af65e316e26715bf.tar.gz ghdl-2e56e2424514b788258f0490af65e316e26715bf.tar.bz2 ghdl-2e56e2424514b788258f0490af65e316e26715bf.zip |
vhdl-parse_psl: avoid crash on error. For #2110
-rw-r--r-- | src/vhdl/vhdl-parse_psl.adb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/vhdl/vhdl-parse_psl.adb b/src/vhdl/vhdl-parse_psl.adb index 3d6d7101e..d6168ca23 100644 --- a/src/vhdl/vhdl-parse_psl.adb +++ b/src/vhdl/vhdl-parse_psl.adb @@ -76,9 +76,15 @@ package body Vhdl.Parse_Psl is is Low_B : constant Node := Get_Low_Bound (N); High_B : constant Node := Get_High_Bound (N); - Low : constant Uns32 := Get_Value (Low_B); + Low : Uns32; High : Uns32; begin + if Low_B = Null_Node then + -- Avoid crash on error. + return; + end if; + + Low := Get_Value (Low_B); if Get_Kind (High_B) = N_Inf then return; end if; |