From b131cc1e6762015bd1091d625a4fa9bfd4ccacb7 Mon Sep 17 00:00:00 2001 From: czechbol Date: Wed, 4 Sep 2024 12:58:29 +0200 Subject: [PATCH] fix range conditions Signed-off-by: czechbol --- analyzers/conversion_overflow.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/analyzers/conversion_overflow.go b/analyzers/conversion_overflow.go index c3de89ed13..83b581f902 100644 --- a/analyzers/conversion_overflow.go +++ b/analyzers/conversion_overflow.go @@ -387,10 +387,10 @@ func updateResultFromBinOp(result *rangeResult, binOp *ssa.BinOp, instr *ssa.Con min := result.minValue max := result.maxValue - if min > 0 { + if min >= 0 { result.maxValue = uint(min) } - if max < math.MaxInt { + if max <= math.MaxInt { result.minValue = int(max) } }