2020-12-10 13:06:34 +00:00
|
|
|
pragma abicoder v2;
|
|
|
|
|
|
|
|
contract C {
|
|
|
|
function abiDecodeArray(bytes memory b1, bytes memory b2) public pure {
|
|
|
|
(uint[] memory a, uint[] memory b) = abi.decode(b1, (uint[], uint[]));
|
|
|
|
assert(a.length == b.length); // should fail
|
|
|
|
|
|
|
|
(uint[] memory c, uint[] memory d) = abi.decode(b1, (uint[], uint[]));
|
|
|
|
assert(a.length == c.length);
|
|
|
|
assert(a.length == d.length); // should fail
|
|
|
|
assert(b.length == d.length);
|
|
|
|
assert(b.length == c.length); // should fail
|
|
|
|
|
|
|
|
(uint[] memory e, uint[] memory f, uint[] memory g) = abi.decode(b1, (uint[], uint[], uint[]));
|
|
|
|
assert(e.length == a.length); // should fail
|
|
|
|
assert(f.length == b.length); // should fail
|
|
|
|
assert(e.length == g.length); // should fail
|
|
|
|
|
|
|
|
(uint[][] memory h, uint[][][] memory i, uint j) = abi.decode(b1, (uint[][], uint[][][], uint));
|
2021-03-23 18:15:14 +00:00
|
|
|
require(j < h.length);
|
|
|
|
require(j < i.length);
|
|
|
|
require(j < i[j].length);
|
2020-12-10 13:06:34 +00:00
|
|
|
assert(h[j].length == i[j][j].length); // should fail
|
|
|
|
|
|
|
|
(uint[] memory k, uint[] memory l) = abi.decode(b2, (uint[], uint[]));
|
|
|
|
assert(k.length == a.length); // should fail
|
|
|
|
assert(k.length == l.length); // should fail
|
|
|
|
assert(l.length == b.length); // should fail
|
|
|
|
}
|
|
|
|
}
|
2021-03-31 15:11:54 +00:00
|
|
|
// ====
|
|
|
|
// SMTEngine: all
|
2021-08-23 09:30:12 +00:00
|
|
|
// SMTIgnoreCex: yes
|
2020-12-10 13:06:34 +00:00
|
|
|
// ----
|
2021-08-20 16:47:30 +00:00
|
|
|
// Warning 1218: (1009-1037): CHC: Error trying to invoke SMT solver.
|
|
|
|
// Warning 1218: (1056-1084): CHC: Error trying to invoke SMT solver.
|
|
|
|
// Warning 1218: (1103-1131): CHC: Error trying to invoke SMT solver.
|
2021-03-31 15:11:54 +00:00
|
|
|
// Warning 6328: (182-210): CHC: Assertion violation happens here.
|
|
|
|
// Warning 6328: (335-363): CHC: Assertion violation happens here.
|
|
|
|
// Warning 6328: (414-442): CHC: Assertion violation happens here.
|
|
|
|
// Warning 6328: (560-588): CHC: Assertion violation happens here.
|
|
|
|
// Warning 6328: (607-635): CHC: Assertion violation happens here.
|
|
|
|
// Warning 6328: (654-682): CHC: Assertion violation happens here.
|
|
|
|
// Warning 6328: (879-916): CHC: Assertion violation happens here.
|
2021-08-20 16:47:30 +00:00
|
|
|
// Warning 6328: (1009-1037): CHC: Assertion violation might happen here.
|
|
|
|
// Warning 6328: (1056-1084): CHC: Assertion violation might happen here.
|
|
|
|
// Warning 6328: (1103-1131): CHC: Assertion violation might happen here.
|
|
|
|
// Warning 4661: (1009-1037): BMC: Assertion violation happens here.
|
|
|
|
// Warning 4661: (1056-1084): BMC: Assertion violation happens here.
|
|
|
|
// Warning 4661: (1103-1131): BMC: Assertion violation happens here.
|