mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #4018 from ethereum/disable-bytes0
Disable FixedBytesType(0) aka bytes0
This commit is contained in:
@@ -1264,17 +1264,12 @@ bool StringLiteralType::isValidUTF8() const
|
||||
return dev::validateUTF8(m_value);
|
||||
}
|
||||
|
||||
shared_ptr<FixedBytesType> FixedBytesType::smallestTypeForLiteral(string const& _literal)
|
||||
{
|
||||
if (_literal.length() <= 32)
|
||||
return make_shared<FixedBytesType>(_literal.length());
|
||||
return shared_ptr<FixedBytesType>();
|
||||
}
|
||||
|
||||
FixedBytesType::FixedBytesType(int _bytes): m_bytes(_bytes)
|
||||
{
|
||||
solAssert(m_bytes >= 0 && m_bytes <= 32,
|
||||
"Invalid byte number for fixed bytes type: " + dev::toString(m_bytes));
|
||||
solAssert(
|
||||
m_bytes > 0 && m_bytes <= 32,
|
||||
"Invalid byte number for fixed bytes type: " + dev::toString(m_bytes)
|
||||
);
|
||||
}
|
||||
|
||||
bool FixedBytesType::isImplicitlyConvertibleTo(Type const& _convertTo) const
|
||||
|
||||
Reference in New Issue
Block a user