diff options
author | Tristan Gingold <tgingold@free.fr> | 2021-03-14 18:18:27 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2021-03-14 18:18:27 +0100 |
commit | f16cb5d7ef37f5f66b79b1c10aedc46c2060b7cc (patch) | |
tree | 0c559474bbfa8fc846f3ea56721140cbfa046d01 /src | |
parent | 6a9939f30d82aa50d9ea9d8c0fc7ee41553e817a (diff) | |
download | ghdl-f16cb5d7ef37f5f66b79b1c10aedc46c2060b7cc.tar.gz ghdl-f16cb5d7ef37f5f66b79b1c10aedc46c2060b7cc.tar.bz2 ghdl-f16cb5d7ef37f5f66b79b1c10aedc46c2060b7cc.zip |
synth-expr.adb: handle const right in synth_short_circuit. Fix #1685
Diffstat (limited to 'src')
-rw-r--r-- | src/synth/synth-expr.adb | 6 |
1 files changed, 6 insertions, 0 deletions
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 |