-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
84 changed files
with
1,772 additions
and
3 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
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
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
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
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
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
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
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
18 changes: 18 additions & 0 deletions
18
test/libsolidity/memoryGuardTests/unmarked_with_memory_access_mcopy.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,18 @@ | ||
contract C { | ||
constructor() { | ||
assembly { | ||
mcopy(1000, 2000, 1000) | ||
} | ||
} | ||
|
||
function copy() public { | ||
assembly { | ||
mcopy(1000, 2000, 1000) | ||
} | ||
} | ||
} | ||
// ==== | ||
// EVMVersion: >=cancun | ||
// ---- | ||
// :C(creation) false | ||
// :C(runtime) false |
18 changes: 18 additions & 0 deletions
18
test/libsolidity/memoryGuardTests/unmarked_with_memory_access_mcopy_zero_size.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,18 @@ | ||
contract C { | ||
constructor() { | ||
assembly { | ||
mcopy(1000, 2000, 0) | ||
} | ||
} | ||
|
||
function copy() public { | ||
assembly { | ||
mcopy(1000, 2000, 0) | ||
} | ||
} | ||
} | ||
// ==== | ||
// EVMVersion: >=cancun | ||
// ---- | ||
// :C(creation) false | ||
// :C(runtime) false |
16 changes: 16 additions & 0 deletions
16
test/libsolidity/memoryGuardTests/unmarked_with_memory_access_mstore.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,16 @@ | ||
contract C { | ||
constructor() { | ||
assembly { | ||
mstore(0, 1) | ||
} | ||
} | ||
|
||
function store() public { | ||
assembly { | ||
mstore(0, 1) | ||
} | ||
} | ||
} | ||
// ---- | ||
// :C(creation) false | ||
// :C(runtime) false |
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,14 @@ | ||
contract C { | ||
function f(bytes memory src) public pure returns (bytes memory dst) { | ||
assembly { | ||
mcopy(add(dst, 0x1f), add(src, 0x1f), 0x01) // Copy over src length byte to dst | ||
mcopy(add(dst, 0x20), add(src, 0x00), 0x08) // Copy 8 zero bytes to dst | ||
mcopy(add(dst, 0x28), add(src, 0x28), 0x10) // Copy 16 bytes from the middle of src to dst | ||
mcopy(add(dst, 0x38), add(src, 0x00), 0x08) // Copy 8 zero bytes to dst | ||
} | ||
} | ||
} | ||
// ==== | ||
// EVMVersion: >=cancun | ||
// ---- | ||
// f(bytes): 0x20, 0x20, 0xffeeddccbbaa9988776655443322110000112233445566778899aabbccddeeff -> 0x20, 0x20, 0x0000000000000000776655443322110000112233445566770000000000000000 |
Oops, something went wrong.