diff options
author | chriseth <chris@ethereum.org> | 2018-06-22 00:53:31 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-22 00:53:31 +0800 |
commit | 32f2db780c6d4d5ca507c595c8f15cacb51972c7 (patch) | |
tree | 8a443d1486e0bc3d6818ef3fa59aaacadad80ce5 /libsolidity | |
parent | 966ecaaf79075f3f1c2fad7853d00bfa875d5e46 (diff) | |
parent | a5f0caa17817bb165f28fc45380ed264725b1252 (diff) | |
download | dexon-solidity-32f2db780c6d4d5ca507c595c8f15cacb51972c7.tar dexon-solidity-32f2db780c6d4d5ca507c595c8f15cacb51972c7.tar.gz dexon-solidity-32f2db780c6d4d5ca507c595c8f15cacb51972c7.tar.bz2 dexon-solidity-32f2db780c6d4d5ca507c595c8f15cacb51972c7.tar.lz dexon-solidity-32f2db780c6d4d5ca507c595c8f15cacb51972c7.tar.xz dexon-solidity-32f2db780c6d4d5ca507c595c8f15cacb51972c7.tar.zst dexon-solidity-32f2db780c6d4d5ca507c595c8f15cacb51972c7.zip |
Merge pull request #4301 from rnaby/TypeChecker
Simplification of typeSupportedByOldABIEncoder
Diffstat (limited to 'libsolidity')
-rw-r--r-- | libsolidity/analysis/TypeChecker.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp index 671e4030..c19ca76d 100644 --- a/libsolidity/analysis/TypeChecker.cpp +++ b/libsolidity/analysis/TypeChecker.cpp @@ -41,15 +41,13 @@ bool typeSupportedByOldABIEncoder(Type const& _type) { if (_type.dataStoredIn(DataLocation::Storage)) return true; - else if (_type.category() == Type::Category::Struct) + if (_type.category() == Type::Category::Struct) return false; - else if (_type.category() == Type::Category::Array) + if (_type.category() == Type::Category::Array) { auto const& arrayType = dynamic_cast<ArrayType const&>(_type); auto base = arrayType.baseType(); - if (!typeSupportedByOldABIEncoder(*base)) - return false; - else if (base->category() == Type::Category::Array && base->isDynamicallySized()) + if (!typeSupportedByOldABIEncoder(*base) || (base->category() == Type::Category::Array && base->isDynamicallySized())) return false; } return true; |