Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

strings not passed/returned/cast properly to/from functions/modifiers #123

Open
dddejan opened this issue Jan 13, 2020 · 3 comments
Open
Labels
bug Something isn't working

Comments

@dddejan
Copy link
Member

dddejan commented Jan 13, 2020

pragma solidity >=0.5.0;
contract A {
    modifier m(string memory msg) { _; }
    function f() public m("heyheyhey") {}
}

gives

$ solc-verify.py modifier_string.sol --output .
Error while running verifier, details:
Parsing ./modifier_string.sol.bpl
./modifier_string.sol.bpl(23,1): Error: mismatched types in assignment command (cannot assign int_arr_type to int_arr_ptr)
1 type checking errors detected in ./modifier_string.sol.bpl
@dddejan dddejan changed the title strings not passed properly to modifiers strings not passed properly to modifiers (cannot assign int_arr_type to int_arr_ptr) Jan 13, 2020
@dddejan dddejan added the bug Something isn't working label Jan 13, 2020
@dddejan dddejan changed the title strings not passed properly to modifiers (cannot assign int_arr_type to int_arr_ptr) strings not passed properly to functions/modifiers Jan 16, 2020
@dddejan
Copy link
Member Author

dddejan commented Jan 16, 2020

Another example

pragma solidity >=0.5.0;
contract A {
  uint x;
  function f(bytes32 b) public view returns (uint) {
      return x;
  }
  function g() public view returns (uint) {
    return f("heyheyhey");
  }
}

Currently gives

$ solc-verify.py issue.sol --output .
Error while running verifier, details:
Parsing ./issue.sol.bpl
./issue.sol.bpl(38,1): Error: mismatched types in assignment command (cannot assign int_arr_type to int)
1 type checking errors detected in ./issue.sol.bpl

@dddejan
Copy link
Member Author

dddejan commented Jan 16, 2020

Another example

pragma solidity >=0.5.0;
contract A {
  bytes32 public constant name = "heyheyhey";
  function f() view public returns(bytes32) {
    return name;
  }
}

Currently gives

$ solc-verify.py issue.sol --output .
Error while running verifier, details:
Parsing ./issue.sol.bpl
./issue.sol.bpl(21,1): Error: mismatched types in assignment command (cannot assign int_arr_type to int)
1 type checking errors detected in ./issue.sol.bpl

@dddejan dddejan changed the title strings not passed properly to functions/modifiers strings not passed/returned/cast properly to/from functions/modifiers Jan 16, 2020
@dddejan
Copy link
Member Author

dddejan commented Jan 16, 2020

Another example

pragma solidity >=0.5.0;
contract A {
  bytes32 name = "heyheyhey";
}

Gives

$ solc-verify.py issue.sol --output .
Error while running verifier, details:
Parsing ./issue.sol.bpl
./issue.sol.bpl(23,28): Error: right-hand side in map store with wrong type: int_arr_type (expected: int)
1 type checking errors detected in ./issue.sol.bpl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant