solidity
solidity copied to clipboard
ABICoderV2 causes execution reverted when decoder bytes to two-dimensional array
Environment
- Compiler version:
- Target EVM version (as per compiler settings): None
- Framework/IDE (e.g. Truffle or Remix): None
- EVM execution environment / backend / blockchain client: None
- Operating system: Linux
Steps to Reproduce
pragma experimental ABIEncoderV2;
contract C{
function f() public returns (uint) {
bytes memory corrupt = abi.encode(uint(32),uint(0));
uint[][2] memory decoded = abi.decode(corrupt, (uint[][2]));
}
}
Run in remix
Run in geth evm
{"output":"","gasUsed":"0x3f6","error":"execution reverted"}
Analyse
If we replace uint[][2] with uint[2], the program executes normally.