Fix crash when passing zero to bytes.concat()

This commit is contained in:
Kamil Śliwak
2021-06-25 21:26:28 +02:00
parent cbf1c3ae69
commit ca0b1bf3f3
9 changed files with 127 additions and 0 deletions
@@ -0,0 +1,15 @@
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"