Merge pull request #10270 from ethereum/copyByteArrayFromStorageToStorage

[SolYul] Copy byte arrays from storage to storage.
This commit is contained in:
chriseth
2020-11-17 00:30:30 +01:00
committed by GitHub
7 changed files with 132 additions and 124 deletions
+1 -1
View File
@@ -128,7 +128,7 @@ function test_solc_behaviour()
sed -i.bak -e '/^Warning (3805): This is a pre-release compiler version, please do not use it in production./d' "$stderr_path"
sed -i.bak -e 's/\(^[ ]*auxdata: \)0x[0-9a-f]*$/\1<AUXDATA REMOVED>/' "$stdout_path"
sed -i.bak -e 's/ Consider adding "pragma .*$//' "$stderr_path"
sed -i.bak -e 's/\(Unimplemented feature error: .* in \).*$/\1<FILENAME REMOVED>/' "$stderr_path"
sed -i.bak -e 's/\(Unimplemented feature error.* in \).*$/\1<FILENAME REMOVED>/' "$stderr_path"
sed -i.bak -e 's/"version": "[^"]*"/"version": "<VERSION REMOVED>"/' "$stdout_path"
# Remove bytecode (but not linker references). Since non-JSON output is unstructured,
+3 -3
View File
@@ -1,5 +1,5 @@
Error (1834): Unimplemented feature error: Copying from storage to storage is not yet implemented. in <FILENAME REMOVED>
--> yul_unimplemented/input.sol:7:9:
Error (1834): Unimplemented feature error in <FILENAME REMOVED>
--> yul_unimplemented/input.sol:8:9:
|
7 | a = b;
8 | x.f();
| ^^^^^
@@ -1,9 +1,10 @@
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.0;
library L { function f(uint) public {} }
contract test {
bytes a;
bytes b;
using L for uint;
function f() public {
a = b;
uint x;
x.f();
}
}
@@ -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