diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2018-07-12 22:04:16 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-12 22:04:16 +0800 |
commit | 0dd79bc1724bfd5031dd6d1bc3b4c1eda283b5f3 (patch) | |
tree | 927ca5986d95cf8f0cd1cf53ab42336925b1ac91 /libsolidity/codegen | |
parent | fa8102880f87c5a2806d59f959fd3e8a62dd4dc9 (diff) | |
parent | 7355298c2f4a1283036f7cb6be349a583a4f4111 (diff) | |
download | dexon-solidity-0dd79bc1724bfd5031dd6d1bc3b4c1eda283b5f3.tar dexon-solidity-0dd79bc1724bfd5031dd6d1bc3b4c1eda283b5f3.tar.gz dexon-solidity-0dd79bc1724bfd5031dd6d1bc3b4c1eda283b5f3.tar.bz2 dexon-solidity-0dd79bc1724bfd5031dd6d1bc3b4c1eda283b5f3.tar.lz dexon-solidity-0dd79bc1724bfd5031dd6d1bc3b4c1eda283b5f3.tar.xz dexon-solidity-0dd79bc1724bfd5031dd6d1bc3b4c1eda283b5f3.tar.zst dexon-solidity-0dd79bc1724bfd5031dd6d1bc3b4c1eda283b5f3.zip |
Merge pull request #4479 from ethereum/fixFixedPointCrash
Fix handling of fixed point types in arithmetics.
Diffstat (limited to 'libsolidity/codegen')
-rw-r--r-- | libsolidity/codegen/ExpressionCompiler.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/libsolidity/codegen/ExpressionCompiler.cpp b/libsolidity/codegen/ExpressionCompiler.cpp index dfa3e58f..4cec69c8 100644 --- a/libsolidity/codegen/ExpressionCompiler.cpp +++ b/libsolidity/codegen/ExpressionCompiler.cpp @@ -349,6 +349,10 @@ bool ExpressionCompiler::visit(UnaryOperation const& _unaryOperation) case Token::Inc: // ++ (pre- or postfix) case Token::Dec: // -- (pre- or postfix) solAssert(!!m_currentLValue, "LValue not retrieved."); + solUnimplementedAssert( + _unaryOperation.annotation().type->category() != Type::Category::FixedPoint, + "Not yet implemented - FixedPointType." + ); m_currentLValue->retrieveValue(_unaryOperation.location()); if (!_unaryOperation.isPrefixOperation()) { @@ -1647,12 +1651,12 @@ void ExpressionCompiler::appendOrdinaryBinaryOperatorCode(Token::Value _operator void ExpressionCompiler::appendArithmeticOperatorCode(Token::Value _operator, Type const& _type) { - IntegerType const& type = dynamic_cast<IntegerType const&>(_type); - bool const c_isSigned = type.isSigned(); - if (_type.category() == Type::Category::FixedPoint) solUnimplemented("Not yet implemented - FixedPointType."); + IntegerType const& type = dynamic_cast<IntegerType const&>(_type); + bool const c_isSigned = type.isSigned(); + switch (_operator) { case Token::Add: |