mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Fixes handling bitwise operators for z3 model checker
This commit is contained in:
parent
411841cbb5
commit
a38549dc19
@ -8,6 +8,7 @@ Compiler Features:
|
||||
|
||||
Bugfixes:
|
||||
* TypeChecker: Also allow external library functions in ``using for``.
|
||||
* SMTChecker: Fix internal error caused by unhandled ``z3`` expressions that come from the solver when bitwise operators are used.
|
||||
|
||||
|
||||
### 0.8.18 (2023-02-01)
|
||||
|
@ -344,6 +344,12 @@ Expression Z3Interface::fromZ3Expr(z3::expr const& _expr)
|
||||
return arguments[0] % arguments[1];
|
||||
else if (kind == Z3_OP_XOR)
|
||||
return arguments[0] ^ arguments[1];
|
||||
else if (kind == Z3_OP_BOR)
|
||||
return arguments[0] | arguments[1];
|
||||
else if (kind == Z3_OP_BAND)
|
||||
return arguments[0] & arguments[1];
|
||||
else if (kind == Z3_OP_BXOR)
|
||||
return arguments[0] ^ arguments[1];
|
||||
else if (kind == Z3_OP_BNOT)
|
||||
return !arguments[0];
|
||||
else if (kind == Z3_OP_BSHL)
|
||||
|
@ -0,0 +1,12 @@
|
||||
contract C {
|
||||
// tests that bitwise operators are parsed from z3 answer
|
||||
function test(uint x, uint y) public pure {
|
||||
x | y;
|
||||
x & y;
|
||||
x ^ y;
|
||||
assert(true);
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// SMTEngine: all
|
||||
// ----
|
Loading…
Reference in New Issue
Block a user