aboutsummaryrefslogtreecommitdiffstats
path: root/src/vhdl/vhdl-sem_stmts.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2021-05-28 20:57:02 +0200
committerTristan Gingold <tgingold@free.fr>2021-05-28 20:57:02 +0200
commitac49cafe30e4b67eebd73d69db45d294ea7e8522 (patch)
tree61878a382bf646f61674dcb44af8dc571337a564 /src/vhdl/vhdl-sem_stmts.adb
parent79a66cd66cec9750c2eff204087b0e2b65bb5d4a (diff)
downloadghdl-ac49cafe30e4b67eebd73d69db45d294ea7e8522.tar.gz
ghdl-ac49cafe30e4b67eebd73d69db45d294ea7e8522.tar.bz2
ghdl-ac49cafe30e4b67eebd73d69db45d294ea7e8522.zip
vhdl: avoid a crash on forced analysis of a erroneous name expression
Diffstat (limited to 'src/vhdl/vhdl-sem_stmts.adb')
-rw-r--r--src/vhdl/vhdl-sem_stmts.adb8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/vhdl/vhdl-sem_stmts.adb b/src/vhdl/vhdl-sem_stmts.adb
index dfe49cfd2..f9290c61c 100644
--- a/src/vhdl/vhdl-sem_stmts.adb
+++ b/src/vhdl/vhdl-sem_stmts.adb
@@ -1021,7 +1021,9 @@ package body Vhdl.Sem_Stmts is
for S in Resolve_Stages loop
Done := False;
- Target := Sem_Expression_Wildcard (Target, Stmt_Type);
+ if Target /= Null_Iir then
+ Target := Sem_Expression_Wildcard (Target, Stmt_Type);
+ end if;
if Target = Null_Iir then
Target_Type := Stmt_Type;
-- To avoid spurious errors, assume the target is fully
@@ -1073,7 +1075,9 @@ package body Vhdl.Sem_Stmts is
exit when Done;
if not Is_Defined_Type (Stmt_Type) then
Error_Msg_Sem (+Stmt, "cannot resolve type");
- if Get_Kind (Target) = Iir_Kind_Aggregate then
+ if Target /= Null_Iir
+ and then Get_Kind (Target) = Iir_Kind_Aggregate
+ then
-- Try to give an advice.
Error_Msg_Sem (+Stmt, "use a qualified expression for the RHS");
end if;