From b6cd3e154c814530540806e19aa08763f6806eac Mon Sep 17 00:00:00 2001 From: Daniel Kirchner Date: Wed, 12 Jan 2022 13:15:58 +0100 Subject: [PATCH] Test case for current behaviour. --- .../pops_in_reverting_branch.yul | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 test/libyul/evmCodeTransform/pops_in_reverting_branch.yul diff --git a/test/libyul/evmCodeTransform/pops_in_reverting_branch.yul b/test/libyul/evmCodeTransform/pops_in_reverting_branch.yul new file mode 100644 index 000000000..48142ac46 --- /dev/null +++ b/test/libyul/evmCodeTransform/pops_in_reverting_branch.yul @@ -0,0 +1,44 @@ +object "main" { + code { + let a := calldataload(0) + let b := calldataload(32) + if calldataload(64) { + revert(0,0) + } + sstore(b, a) + } +} +// ==== +// stackOptimization: true +// ---- +// /* "":51:52 */ +// 0x00 +// /* "":38:53 */ +// calldataload +// /* "":81:83 */ +// 0x20 +// /* "":68:84 */ +// calldataload +// /* "":106:108 */ +// 0x40 +// /* "":93:109 */ +// calldataload +// /* "":90:139 */ +// tag_1 +// jumpi +// /* "":22:160 */ +// tag_2: +// /* "":145:157 */ +// sstore +// /* "":22:160 */ +// stop +// /* "":110:139 */ +// tag_1: +// /* "":121:132 */ +// pop +// pop +// /* "":130:131 */ +// 0x00 +// /* "":121:132 */ +// dup1 +// revert