diff options
author | Tristan Gingold <tgingold@free.fr> | 2019-06-13 18:18:07 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2019-06-13 18:18:07 +0200 |
commit | a1a032768770c502292a7d0c632fba17aef8c012 (patch) | |
tree | ad4acc41c7dde19e99299d24f6f6e046b5abac87 | |
parent | a868ef001e20329f0ffe6bf6557f2d7381f96bfe (diff) | |
download | ghdl-a1a032768770c502292a7d0c632fba17aef8c012.tar.gz ghdl-a1a032768770c502292a7d0c632fba17aef8c012.tar.bz2 ghdl-a1a032768770c502292a7d0c632fba17aef8c012.zip |
vhdl-sem_expr: avoid crash if no choices.
-rw-r--r-- | src/vhdl/vhdl-sem_expr.adb | 4 |
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; |