From a1a032768770c502292a7d0c632fba17aef8c012 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Thu, 13 Jun 2019 18:18:07 +0200 Subject: vhdl-sem_expr: avoid crash if no choices. --- src/vhdl/vhdl-sem_expr.adb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; -- cgit v1.2.3