diff options
author | Erik Kundt <bitshift@posteo.org> | 2018-10-10 23:06:48 +0800 |
---|---|---|
committer | chriseth <chris@ethereum.org> | 2018-10-30 22:14:57 +0800 |
commit | 1d8e9af407fc8c47cae6401fb71463771d397d30 (patch) | |
tree | 8dbec3f3b37f938c912b38b6d21a22f620f554d3 /libsolidity | |
parent | 0b4f6ab72d36e68ce9bf5a10da0d785059d8709c (diff) | |
download | dexon-solidity-1d8e9af407fc8c47cae6401fb71463771d397d30.tar.gz dexon-solidity-1d8e9af407fc8c47cae6401fb71463771d397d30.tar.zst dexon-solidity-1d8e9af407fc8c47cae6401fb71463771d397d30.zip |
Fixes crash while encoding too large arrays.
Diffstat (limited to 'libsolidity')
-rw-r--r-- | libsolidity/ast/Types.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libsolidity/ast/Types.cpp b/libsolidity/ast/Types.cpp index 301687b4..d5d11478 100644 --- a/libsolidity/ast/Types.cpp +++ b/libsolidity/ast/Types.cpp @@ -1698,6 +1698,9 @@ bool ArrayType::operator==(Type const& _other) const bool ArrayType::validForCalldata() const { + if (auto arrayBaseType = dynamic_cast<ArrayType const*>(baseType().get())) + if (!arrayBaseType->validForCalldata()) + return false; return unlimitedCalldataEncodedSize(true) <= numeric_limits<unsigned>::max(); } |