diff options
author | Christian <c@ethdev.com> | 2014-12-17 23:23:18 +0800 |
---|---|---|
committer | Christian <c@ethdev.com> | 2014-12-17 23:24:56 +0800 |
commit | 5a1a83ff42b97f85e06c54c7d5fe7db2f8239e5a (patch) | |
tree | 3aaf794ca4352fedfb7b651a5722b3ff2a588e1b /Types.cpp | |
parent | 3d98ec1323f604130c0dba87ce4596f04ffa0269 (diff) | |
download | dexon-solidity-5a1a83ff42b97f85e06c54c7d5fe7db2f8239e5a.tar dexon-solidity-5a1a83ff42b97f85e06c54c7d5fe7db2f8239e5a.tar.gz dexon-solidity-5a1a83ff42b97f85e06c54c7d5fe7db2f8239e5a.tar.bz2 dexon-solidity-5a1a83ff42b97f85e06c54c7d5fe7db2f8239e5a.tar.lz dexon-solidity-5a1a83ff42b97f85e06c54c7d5fe7db2f8239e5a.tar.xz dexon-solidity-5a1a83ff42b97f85e06c54c7d5fe7db2f8239e5a.tar.zst dexon-solidity-5a1a83ff42b97f85e06c54c7d5fe7db2f8239e5a.zip |
Assertions that throw InternalCompilerErrors.
Diffstat (limited to 'Types.cpp')
-rw-r--r-- | Types.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
@@ -22,6 +22,7 @@ #include <libdevcore/CommonIO.h> #include <libdevcore/CommonData.h> +#include <libsolidity/Utils.h> #include <libsolidity/Types.h> #include <libsolidity/AST.h> @@ -34,8 +35,7 @@ namespace solidity shared_ptr<Type const> Type::fromElementaryTypeName(Token::Value _typeToken) { - if (asserts(Token::isElementaryTypeName(_typeToken))) - BOOST_THROW_EXCEPTION(InternalCompilerError()); + solAssert(Token::isElementaryTypeName(_typeToken), ""); if (Token::INT <= _typeToken && _typeToken <= Token::HASH256) { @@ -120,8 +120,8 @@ IntegerType::IntegerType(int _bits, IntegerType::Modifier _modifier): { if (isAddress()) m_bits = 160; - if (asserts(m_bits > 0 && m_bits <= 256 && m_bits % 8 == 0)) - BOOST_THROW_EXCEPTION(InternalCompilerError() << errinfo_comment("Invalid bit number for integer type: " + dev::toString(_bits))); + solAssert(m_bits > 0 && m_bits <= 256 && m_bits % 8 == 0, + "Invalid bit number for integer type: " + dev::toString(_bits)); } bool IntegerType::isImplicitlyConvertibleTo(Type const& _convertTo) const @@ -215,9 +215,8 @@ shared_ptr<StaticStringType> StaticStringType::smallestTypeForLiteral(string con StaticStringType::StaticStringType(int _bytes): m_bytes(_bytes) { - if (asserts(m_bytes >= 0 && m_bytes <= 32)) - BOOST_THROW_EXCEPTION(InternalCompilerError() << errinfo_comment("Invalid byte number for static string type: " + - dev::toString(m_bytes))); + solAssert(m_bytes >= 0 && m_bytes <= 32, + "Invalid byte number for static string type: " + dev::toString(m_bytes)); } bool StaticStringType::isImplicitlyConvertibleTo(Type const& _convertTo) const |