Do not allow assignment from literal strings to storage pointers.

Fixes #90
This commit is contained in:
chriseth 2015-09-23 17:26:17 +02:00
parent c4b7916c14
commit 8a9b9e4fdb

View File

@ -511,7 +511,9 @@ bool StringLiteralType::isImplicitlyConvertibleTo(Type const& _convertTo) const
if (auto fixedBytes = dynamic_cast<FixedBytesType const*>(&_convertTo))
return size_t(fixedBytes->numBytes()) >= m_value.size();
else if (auto arrayType = dynamic_cast<ArrayType const*>(&_convertTo))
return arrayType->isByteArray();
return
arrayType->isByteArray() &&
!(arrayType->dataStoredIn(DataLocation::Storage) && arrayType->isPointer());
else
return false;
}