diff options
author | chriseth <chris@ethereum.org> | 2017-11-21 20:40:21 +0800 |
---|---|---|
committer | chriseth <chris@ethereum.org> | 2017-11-22 23:25:24 +0800 |
commit | 6ed4e0632f18f4dc6d7c2db4c5ad6b0f64c9e225 (patch) | |
tree | 8985af94d7bcc3b918485f2d65e690917b832c4f /libsolidity | |
parent | 6dbc34e16ee8bda0e156ccb20a3fb8cb6ff52c92 (diff) | |
download | dexon-solidity-6ed4e0632f18f4dc6d7c2db4c5ad6b0f64c9e225.tar.gz dexon-solidity-6ed4e0632f18f4dc6d7c2db4c5ad6b0f64c9e225.tar.zst dexon-solidity-6ed4e0632f18f4dc6d7c2db4c5ad6b0f64c9e225.zip |
Use if statement in abi functions.
Diffstat (limited to 'libsolidity')
-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) } |