fixed assigning negative number to unsigned

This commit is contained in:
Liana Husikyan 2015-06-04 14:09:19 +02:00
parent 89aab7e234
commit 4e15a39107

View File

@ -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;
}