-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes crash while encoding too large arrays.
- Loading branch information
Showing
5 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
test/libsolidity/syntaxTests/array/length/parameter_too_large.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
contract C { | ||
function f(bytes32[1263941234127518272] memory) public pure {} | ||
} | ||
// ---- | ||
// TypeError: (26-61): Array is too large to be encoded. |
11 changes: 11 additions & 0 deletions
11
test/libsolidity/syntaxTests/array/length/parameter_too_large_multidim.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
contract C { | ||
function f(bytes32[1263941234127518272][500] memory) public pure {} | ||
function f(uint[2**30][] memory) public pure {} | ||
function f(uint[2**30][2**30][] memory) public pure {} | ||
function f(uint[2**16][2**16][] memory) public pure {} | ||
} | ||
// ---- | ||
// TypeError: (26-66): Array is too large to be encoded. | ||
// TypeError: (96-116): Array is too large to be encoded. | ||
// TypeError: (146-173): Array is too large to be encoded. | ||
// TypeError: (203-230): Array is too large to be encoded. |
10 changes: 10 additions & 0 deletions
10
test/libsolidity/syntaxTests/array/length/parameter_too_large_multidim_ABIv2.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
pragma experimental ABIEncoderV2; | ||
|
||
contract C { | ||
function f(bytes32[1263941234127518272][500] memory) public pure {} | ||
function f(uint[2**30][2**30][][] memory) public pure {} | ||
} | ||
// ---- | ||
// Warning: (0-33): Experimental features are turned on. Do not use experimental features on live deployments. | ||
// TypeError: (61-101): Array is too large to be encoded. | ||
// TypeError: (131-160): Array is too large to be encoded. |