Skip to content

Issue with casting and verifier functions #146

@dddejan

Description

@dddejan
pragma solidity >=0.5.0;

contract FunctionArgs {

  uint8 x;
  uint y;

  /// postcondition x == __verifier_old_uint(x)
  function noop() public view returns (bool ok) {
    assert(x == y);
    return true;
  }
}

Gives

$ solc-verify.py FunctionArgs.sol --arith bv --output .
Error while running verifier, details:
Parsing ./FunctionArgs.sol.bpl
./FunctionArgs.sol.bpl(23,172): Error: invalid argument types (bv256 and bv8) to binary operator ==
1 type checking errors detected in ./FunctionArgs.sol.bpl

The culprit is the old expression bvzeroext_8_to_256(x#3[__this]) == old(x#3[__this]).

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions