From 2e56e2424514b788258f0490af65e316e26715bf Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Sun, 26 Jun 2022 07:21:28 +0200 Subject: vhdl-parse_psl: avoid crash on error. For #2110 --- src/vhdl/vhdl-parse_psl.adb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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; -- cgit v1.2.3