aboutsummaryrefslogtreecommitdiffstats
path: root/src/vhdl
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2021-03-28 15:41:50 +0200
committerTristan Gingold <tgingold@free.fr>2021-03-28 15:41:50 +0200
commit7882ec7c7dd687910d31adb6e31dd26f59bfd92f (patch)
tree4bb06a2bf93f64cc1904097ae36abfa3b42163fc /src/vhdl
parentd696b12acb0d764f493f3757a4db8bb7f3593df1 (diff)
downloadghdl-7882ec7c7dd687910d31adb6e31dd26f59bfd92f.tar.gz
ghdl-7882ec7c7dd687910d31adb6e31dd26f59bfd92f.tar.bz2
ghdl-7882ec7c7dd687910d31adb6e31dd26f59bfd92f.zip
vhdl-parse_psl: avoid crash in case of error. For #1701
Diffstat (limited to 'src/vhdl')
-rw-r--r--src/vhdl/vhdl-parse_psl.adb11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/vhdl/vhdl-parse_psl.adb b/src/vhdl/vhdl-parse_psl.adb
index d54924212..eaabd852b 100644
--- a/src/vhdl/vhdl-parse_psl.adb
+++ b/src/vhdl/vhdl-parse_psl.adb
@@ -79,13 +79,18 @@ package body Vhdl.Parse_Psl is
end if;
end Check_Positive_Count;
- procedure Parse_Count (N : Node) is
+ procedure Parse_Count (N : Node)
+ is
+ Hi : Node;
begin
Set_Low_Bound (N, Parse_Number);
if Current_Token = Tok_To then
Scan;
- Set_High_Bound (N, Parse_Number);
- Check_Positive_Count (N);
+ Hi := Parse_Number;
+ Set_High_Bound (N, Hi);
+ if Hi /= Null_Node then
+ Check_Positive_Count (N);
+ end if;
end if;
end Parse_Count;