From 7b60fc68cf36f3fb1861f525bfabc78e4f99a036 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Sun, 12 Jan 2020 21:33:30 +0100 Subject: synth-expr: fix crash with negative values. Fix #1086 --- src/synth/synth-expr.adb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/synth') diff --git a/src/synth/synth-expr.adb b/src/synth/synth-expr.adb index 5d5b57215..c8062e707 100644 --- a/src/synth/synth-expr.adb +++ b/src/synth/synth-expr.adb @@ -164,8 +164,8 @@ package body Synth.Expr is for I in 0 .. Val.Typ.W - 1 loop declare B : constant Uns32 := - Uns32 (Shift_Right (To_Uns64 (Val.Scal), Natural (I))) - and 1; + Uns32 (Shift_Right (To_Uns64 (Val.Scal), Natural (I)) + and 1); Idx : constant Digit_Index := Digit_Index (Off / 32); Pos : constant Natural := Natural (Off mod 32); begin -- cgit v1.2.3