From f16cb5d7ef37f5f66b79b1c10aedc46c2060b7cc Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Sun, 14 Mar 2021 18:18:27 +0100 Subject: synth-expr.adb: handle const right in synth_short_circuit. Fix #1685 --- src/synth/synth-expr.adb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/synth/synth-expr.adb b/src/synth/synth-expr.adb index 4fb5d1136..a2ceb6e15 100644 --- a/src/synth/synth-expr.adb +++ b/src/synth/synth-expr.adb @@ -2183,6 +2183,12 @@ package body Synth.Expr is end if; Strip_Const (Right); + if Is_Static_Val (Right.Val) + and then Get_Static_Discrete (Right) = Val + then + return Create_Value_Discrete (Val, Boolean_Type); + end if; + -- Return a static value if both operands are static. -- Note: we know the value of left if it is not constant. if Is_Static_Val (Left.Val) and then Is_Static_Val (Right.Val) then -- cgit v1.2.3