mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Copy byte arrays from storage to storage.
This commit is contained in:
@@ -3,6 +3,8 @@ contract c {
|
||||
function copy(uint from, uint to) public returns (bool) { data[to] = data[from]; return true; }
|
||||
mapping(uint => bytes) data;
|
||||
}
|
||||
// ====
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// set(uint256): 1, 2 -> true
|
||||
// set(uint256): 2, 2, 3, 4, 5 -> true
|
||||
|
||||
@@ -5,6 +5,8 @@ contract c {
|
||||
bytes data1;
|
||||
bytes data2;
|
||||
}
|
||||
// ====
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// set(): 1, 2, 3, 4, 5 -> true
|
||||
// storage: nonempty
|
||||
|
||||
@@ -12,6 +12,8 @@ contract Test {
|
||||
return bytes(s).length;
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// f(string,uint256): 0x40, 0x02, 0x06, "abcdef" -> "c"
|
||||
// l() -> 0x06
|
||||
|
||||
Reference in New Issue
Block a user