Overflow package reports a false negative for 0 quotient #3326
Labels
🐞 bug
Something isn't working
in focus
Core team is prioritizing this work
📦 🌐 tendermint v2
Issues or PRs tm2 related
📦 🤖 gnovm
Issues or PRs gnovm related
The following Go program:
Gives the result
0 -5 false
instead of0 -5 true
. An overflow is reported but it shouldn't be.This affects all variants of
Quotient
function for signed integers:Quotient
,Quotient8
,Quotient16
,Quotient32
andQuotient64
. These functions are used for division/
and remainder%
operators.The bug only affects results where the quotient is 0, all the other cases are correct. Note: in the overflow package, the test suite deliberately skipped the case where quotient is 0.
The issue is also present in https://github.com/gnolang/overflow and https://github.com/JohnCGriffin/overflow.
A fix is provided in #3250, precisely at
gno/tm2/pkg/overflow/overflow_template.sh
Line 93 in bbb84a1
The text was updated successfully, but these errors were encountered: