diff options
author | chriseth <chris@ethereum.org> | 2017-11-27 22:02:46 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-27 22:02:46 +0800 |
commit | a1f59cbb17d29ca5f92fa1cc20d17f47026ade5a (patch) | |
tree | d17e5ab7a2c9cd5ffacba728851e6c127182fbe0 /libsolidity/codegen/ABIFunctions.cpp | |
parent | a7136dbc16ba7e0cf8a7d6097d50cc40c1248914 (diff) | |
parent | 1d91b65b726d4757b866124d75834f28a9bc9eb9 (diff) | |
download | dexon-solidity-a1f59cbb17d29ca5f92fa1cc20d17f47026ade5a.tar dexon-solidity-a1f59cbb17d29ca5f92fa1cc20d17f47026ade5a.tar.gz dexon-solidity-a1f59cbb17d29ca5f92fa1cc20d17f47026ade5a.tar.bz2 dexon-solidity-a1f59cbb17d29ca5f92fa1cc20d17f47026ade5a.tar.lz dexon-solidity-a1f59cbb17d29ca5f92fa1cc20d17f47026ade5a.tar.xz dexon-solidity-a1f59cbb17d29ca5f92fa1cc20d17f47026ade5a.tar.zst dexon-solidity-a1f59cbb17d29ca5f92fa1cc20d17f47026ade5a.zip |
Merge pull request #3220 from ethereum/IuliaIf
If statement for Iulia / Inline Assembly
Diffstat (limited to 'libsolidity/codegen/ABIFunctions.cpp')
-rw-r--r-- | libsolidity/codegen/ABIFunctions.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libsolidity/codegen/ABIFunctions.cpp b/libsolidity/codegen/ABIFunctions.cpp index d2cbac99..bb39cbbb 100644 --- a/libsolidity/codegen/ABIFunctions.cpp +++ b/libsolidity/codegen/ABIFunctions.cpp @@ -168,7 +168,7 @@ string ABIFunctions::cleanupFunction(Type const& _type, bool _revertOnFailure) { size_t members = dynamic_cast<EnumType const&>(_type).numberOfMembers(); solAssert(members > 0, "empty enum should have caused a parser error."); - Whiskers w("switch lt(value, <members>) case 0 { <failure> } cleaned := value"); + Whiskers w("if iszero(lt(value, <members>)) { <failure> } cleaned := value"); w("members", to_string(members)); if (_revertOnFailure) w("failure", "revert(0, 0)"); @@ -988,8 +988,8 @@ string ABIFunctions::copyToMemoryFunction(bool _fromCalldata) { mstore(add(dst, i), mload(add(src, i))) } - switch eq(i, length) - case 0 { + if gt(i, length) + { // clear end mstore(add(dst, length), 0) } |