Uh oh!
There was an error while loading. Please reload this page.
Use SignedAmount::unsigned_abs to avoid overflow - #4383
Conversation
In debug mode, using SignedAmount::abs can lead to an integer overflow when used with SignedAmount::MIN. Use SignedAmount::unsigned_abs to avoid this.
👋 Thanks for assigning @TheBlueMatt as a reviewer! |
TheBlueMatt
left a comment
There was a problem hiding this comment.
Meh, not sure its worth bothering to test a bug that isn't even a bug in prod. The appropriate test would be a CI check that bans the abs method in our code, anyway.
Uh oh!
There was an error while loading. Please reload this page.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@## main #4383 +/- ##
==========================================
- Coverage 86.01% 86.01% -0.01%
==========================================
Files 156 156 Lines 102857 102857 Branches 102857 102857 ==========================================
- Hits 88476 88473 -3 - Misses 11871 11875 +4 + Partials 2510 2509 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
TheBlueMatt
commented
Feb 6, 2026
Backported to 0.2 in #4389 |
In debug mode, using
SignedAmount::abscan lead to an integer overflow when used withSignedAmount::MIN. UseSignedAmount::unsigned_absto avoid this.