From 8a9b9e4fdbead915da0dd725d3dc0ffe45d84065 Mon Sep 17 00:00:00 2001 From: chriseth Date: Wed, 23 Sep 2015 17:26:17 +0200 Subject: Do not allow assignment from literal strings to storage pointers. Fixes #90 --- libsolidity/Types.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'libsolidity') diff --git a/libsolidity/Types.cpp b/libsolidity/Types.cpp index 68e8e91d..e24b8f06 100644 --- a/libsolidity/Types.cpp +++ b/libsolidity/Types.cpp @@ -511,7 +511,9 @@ bool StringLiteralType::isImplicitlyConvertibleTo(Type const& _convertTo) const if (auto fixedBytes = dynamic_cast(&_convertTo)) return size_t(fixedBytes->numBytes()) >= m_value.size(); else if (auto arrayType = dynamic_cast(&_convertTo)) - return arrayType->isByteArray(); + return + arrayType->isByteArray() && + !(arrayType->dataStoredIn(DataLocation::Storage) && arrayType->isPointer()); else return false; } -- cgit v1.2.3