Escape backslashes when formatting

This commit is contained in:
Mathias Baumann
2020-05-13 17:08:37 +02:00
committed by chriseth
parent e9446475bb
commit 820fdd9bf7
7 changed files with 77 additions and 28 deletions
@@ -0,0 +1,13 @@
pragma experimental ABIEncoderV2;
contract C
{
function f() public pure returns (uint, byte, byte) {
bytes memory encoded = abi.encodePacked("\\\\");
return (encoded.length, encoded[0], encoded[1]);
}
}
// ====
// compileViaYul: also
// ----
// f() -> 2, 0x5c00000000000000000000000000000000000000000000000000000000000000, 0x5c00000000000000000000000000000000000000000000000000000000000000