diff options
author | Liana Husikyan <liana@ethdev.com> | 2015-06-04 20:09:19 +0800 |
---|---|---|
committer | Liana Husikyan <liana@ethdev.com> | 2015-06-04 20:09:19 +0800 |
commit | 4e15a391076bfe3421cee0ef6a4bc847ddc0f46f (patch) | |
tree | bd1d5e62e6759681361f2ea9bf61b4fda75760d0 /Types.cpp | |
parent | 89aab7e234e3c96bbae2e4066cfa1249f5d1793e (diff) | |
download | dexon-solidity-4e15a391076bfe3421cee0ef6a4bc847ddc0f46f.tar.gz dexon-solidity-4e15a391076bfe3421cee0ef6a4bc847ddc0f46f.tar.zst dexon-solidity-4e15a391076bfe3421cee0ef6a4bc847ddc0f46f.zip |
fixed assigning negative number to unsigned
Diffstat (limited to 'Types.cpp')
-rw-r--r-- | Types.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -371,7 +371,7 @@ bool IntegerConstantType::isImplicitlyConvertibleTo(Type const& _convertTo) cons if (m_value <= (u256(-1) >> (256 - targetType->getNumBits() + forSignBit))) return true; } - else if (-m_value <= (u256(1) << (targetType->getNumBits() - forSignBit))) + else if (targetType->isSigned() && -m_value <= (u256(1) << (targetType->getNumBits() - forSignBit))) return true; return false; } |