Skip to content

Commit

Permalink
Merge pull request #14988 from pgebal/smt_chcecker_fix_internal_error…
Browse files Browse the repository at this point in the history
…_on_bitwise

SMTChecker: Fix internal error when using bitwise operators with an array as argument
  • Loading branch information
blishko authored Apr 4, 2024
2 parents 6040a52 + 9504612 commit 3d7b3d9
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Compiler Features:


Bugfixes:
* SMTChecker: Fix internal error when using bitwise operators with an array element as argument.


### 0.8.25 (2023-03-14)
Expand Down
2 changes: 2 additions & 0 deletions libsmtutil/Z3Interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,8 @@ Expression Z3Interface::fromZ3Expr(z3::expr const& _expr)
kind == Z3_OP_RECURSIVE
)
return Expression(_expr.decl().name().str(), arguments, fromZ3Sort(_expr.get_sort()));
else if (kind == Z3_OP_CONCAT)
return Expression("concat", arguments, sort);

smtAssert(false);

Expand Down
17 changes: 17 additions & 0 deletions test/libsolidity/smtCheckerTests/operators/bitwise_and_array.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
contract C {
function bitwiseXor(int[10] memory p) public pure {
1 ^ p[0];
}

function bitwiseAnd(int[10] memory p) public pure {
1 & p[0];
}

function bitwiseOr(int[10] memory p) public pure {
1 | p[0];
}
}
// ====
// SMTEngine: all
// ----
// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them.

0 comments on commit 3d7b3d9

Please sign in to comment.