Merge pull request #7770 from ethereum/yul_string_format

[Yul] Format string literals back to quoted string literals
This commit is contained in:
chriseth
2019-11-26 15:51:54 +01:00
committed by GitHub
16 changed files with 842 additions and 4 deletions
@@ -0,0 +1,13 @@
contract C {
function f1() external pure returns (string memory) { return "abcabc"; }
function f2() external pure returns (string memory) { return "abcabc`~12345677890- _=+!@#$%^&*()[{]}|;:',<.>?"; }
function g() external pure returns (bytes32) { return "abcabc"; }
function h() external pure returns (bytes4) { return 0xcafecafe; }
}
// ====
// compileViaYul: only
// ----
// f1() -> 0x20, 6, left(0x616263616263)
// f2() -> 32, 47, 44048183223289766195424279195050628400112610419087780792899004030957505095210, 18165586057823232067963737336409268114628061002662705707816940456850361417728
// g() -> left(0x616263616263)
// h() -> left(0xcafecafe)