Merge pull request #11590 from ethereum/disallow-non-hex-zero-and-fix-bytes32-literals-in-bytes-concat

Disallow non-hex zero literals and fix 32-byte hex literals in `bytes.concat()`
This commit is contained in:
chriseth
2021-06-29 16:34:26 +02:00
committed by GitHub
9 changed files with 76 additions and 45 deletions
@@ -1,15 +0,0 @@
contract C {
function f() public returns (bytes memory) {
return bytes.concat(0, -0, 0.0, -0.0, 0e10, 0e-10, 0x00, (0));
}
function g() public returns (bytes memory) {
return bytes.concat(0, "abc", 0, "abc", 0);
}
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// f() -> 0x20, 8, "\0\0\0\0\0\0\0\0"
// g() -> 0x20, 9, "\0abc\0abc\0"