From 291fde96273b8b2b6520b7834ff5a9d9623a48f4 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Sun, 17 May 2020 09:44:32 +0200 Subject: netlists-inference: avoid a crash for assertions in case statement. Fix #1317 --- src/synth/netlists-inference.adb | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/synth/netlists-inference.adb b/src/synth/netlists-inference.adb index 6ba244888..4e79e7680 100644 --- a/src/synth/netlists-inference.adb +++ b/src/synth/netlists-inference.adb @@ -939,10 +939,15 @@ package body Netlists.Inference is First_Inst := Get_Net_Parent (Val); Inst := First_Inst; loop - if Get_Id (Inst) /= Id_Mux2 then - pragma Assert (Get_Id (Inst) = Id_Const_UB32); - return Val; - end if; + case Get_Id (Inst) is + when Id_Mux2 => + null; + when Id_Const_UB32 + | Id_Pmux => + return Val; + when others => + raise Internal_Error; + end case; Extract_Clock (Ctxt, Get_Input_Net (Inst, 0), Clk, En); exit when Clk /= No_Net; -- cgit v1.2.3