aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2022-06-01 07:57:29 +0200
committerTristan Gingold <tgingold@free.fr>2022-06-01 07:57:29 +0200
commit30b88e21526330c47a52b3c83d661102f6d426ea (patch)
tree68d4c230c4c3248bd7325ce76239a084825baa3b /src
parent0ba57d2457b8341c0ba912cdde12872a349da3b3 (diff)
downloadghdl-30b88e21526330c47a52b3c83d661102f6d426ea.tar.gz
ghdl-30b88e21526330c47a52b3c83d661102f6d426ea.tar.bz2
ghdl-30b88e21526330c47a52b3c83d661102f6d426ea.zip
vhdl-parse: do not allow nested context declaration. For #2070
Diffstat (limited to 'src')
-rw-r--r--src/vhdl/vhdl-parse.adb6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/vhdl/vhdl-parse.adb b/src/vhdl/vhdl-parse.adb
index 0266a494e..b480d797f 100644
--- a/src/vhdl/vhdl-parse.adb
+++ b/src/vhdl/vhdl-parse.adb
@@ -11533,7 +11533,11 @@ package body Vhdl.Parse is
is
End_Loc : Location_Type;
begin
- Set_Library_Unit (Unit, Decl);
+ if Get_Kind (Unit) = Iir_Kind_Context_Declaration then
+ Error_Msg_Parse ("nested context declaration not allowed");
+ else
+ Set_Library_Unit (Unit, Decl);
+ end if;
-- Skip 'is'
Scan;