mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-11-07 19:31:11 +00:00
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:
1 parent
df1921ba93
commit
c0cdde5a5a
4 files changed
+8
-3
No files matched your search
@@ -92,7 +92,7 @@ impl RuntimeFunction for SignedDivision {
|
||||
"max_uint",
|
||||
)?;
|
||||
let is_operand_1_overflow = context.builder().build_int_compare(
|
||||
inkwell::IntPredicate::EQ,
|
||||
inkwell::IntPredicate::SLT,
|
||||
operand_1,
|
||||
context.builder().build_int_neg(max_uint, "min_uint")?,
|
||||
"is_operand_1_overflow",
|
||||
|
||||
Reference in new issue
Block a user