llvm-context: fix off-by-one in SDIV overflow semantics (#398)

- Fix the wrong predicate (the negative side in 2s complement has one
more bit)
- Increase test coverage

Signed-off-by: xermicus <cyrill@parity.io>
This commit is contained in:
xermicus
2025-10-31 14:07:01 +01:00
committed by GitHub
parent df1921ba93
commit c0cdde5a5a
4 changed files with 8 additions and 3 deletions
+2
View File
@@ -169,6 +169,8 @@ fn signed_division() {
(minus_five, two),
(I256::MINUS_ONE, I256::MIN),
(one, I256::ZERO),
(I256::MIN, I256::MINUS_ONE),
(I256::MIN + I256::ONE, I256::MINUS_ONE),
] {
actions.push(Call {
origin: TestAddress::Alice,