aboutsummaryrefslogtreecommitdiffstats
path: root/Types.cpp
diff options
context:
space:
mode:
authorLiana Husikyan <liana@ethdev.com>2015-06-04 20:09:19 +0800
committerLiana Husikyan <liana@ethdev.com>2015-06-04 20:09:19 +0800
commit4e15a391076bfe3421cee0ef6a4bc847ddc0f46f (patch)
treebd1d5e62e6759681361f2ea9bf61b4fda75760d0 /Types.cpp
parent89aab7e234e3c96bbae2e4066cfa1249f5d1793e (diff)
downloaddexon-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.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Types.cpp b/Types.cpp
index c10e29ea..bf79be31 100644
--- a/Types.cpp
+++ b/Types.cpp
@@ -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;
}