Open
Description
Currently, the if
part of a modifies
spec is directly translated into a postcondition, meaning that it will refer to the new values (unless manually adding old(...)
). As discussed in #78, it should refer to the old values by default.
For example, this should not fail:
$ cat test.sol && solc-verify.py test.sol
pragma solidity >=0.5.0;
contract Test {
bool marked;
/// @notice modifies marked if !marked
function mark() public {
require(!marked);
marked = true;
}
}
Test::mark: ERROR
- test.sol:7:5: Function might modify 'marked' illegally
Test::[implicit_constructor]: OK
Use --show-warnings to see 1 warning.
Errors were found by the verifier.