SRI-CSL / solidity

This is solc-verify, a modular verifier for Solidity.
https://github.com/SRI-CSL/solidity/blob/boogie/SOLC-VERIFY-README.md
GNU General Public License v3.0
50 stars 14 forks source link

Support for abi functions (abi.encode, abi.decode) #68

Open dddejan opened 5 years ago

dddejan commented 5 years ago

In test/libsolidity/syntaxTests/specialFunctions/abidecode/abi_decode_memory_v2.sol

pragma experimental "ABIEncoderV2";

contract C {
  struct S { uint x; uint[] b; }
  function f() public pure returns (S memory, bytes memory, uint[][2] memory) {
    return abi.decode("abc", (S, bytes, uint[][2]));
  }
}

The AST goes into parsing the indexed expression uint[][2] and fails in L1133 of ASTBoogieExpressionConverter.cpp:

index->accept(*this); // TODO: can this be a nullptr?

So yes, it can be nullptr :)

We don't support the abi.decode and type parsing yet, but we should try not to segfault.

hajduakos commented 5 years ago

Error message instead of segfault since e361539614c39630030e6f85de9ac1dbdc7ebe5a

hajduakos commented 5 years ago

@dddejan please check and close issue / remove bug label

dddejan commented 5 years ago

Will keep this open to track support for abi.* functions.