aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2019-06-13 18:18:07 +0200
committerTristan Gingold <tgingold@free.fr>2019-06-13 18:18:07 +0200
commita1a032768770c502292a7d0c632fba17aef8c012 (patch)
treead4acc41c7dde19e99299d24f6f6e046b5abac87 /src
parenta868ef001e20329f0ffe6bf6557f2d7381f96bfe (diff)
downloadghdl-a1a032768770c502292a7d0c632fba17aef8c012.tar.gz
ghdl-a1a032768770c502292a7d0c632fba17aef8c012.tar.bz2
ghdl-a1a032768770c502292a7d0c632fba17aef8c012.zip
vhdl-sem_expr: avoid crash if no choices.
Diffstat (limited to 'src')
-rw-r--r--src/vhdl/vhdl-sem_expr.adb4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/vhdl/vhdl-sem_expr.adb b/src/vhdl/vhdl-sem_expr.adb
index 8bb2ad324..013a5c156 100644
--- a/src/vhdl/vhdl-sem_expr.adb
+++ b/src/vhdl/vhdl-sem_expr.adb
@@ -2382,7 +2382,9 @@ package body Vhdl.Sem_Expr is
begin
for I in 1 .. Sel_Length loop
Nbr := Nbr / Sel_El_Length;
- if Nbr = 0 then
+ if Nbr = 0 and then Choice_Chain /= Null_Iir then
+ -- An error has already been reported by parse if there is
+ -- no choices.
Error_Msg_Sem (+Choice_Chain, "missing choice(s)");
exit;
end if;