aboutsummaryrefslogtreecommitdiffstats
path: root/Types.cpp
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2015-06-23 20:55:33 +0800
committerchriseth <c@ethdev.com>2015-06-24 18:18:19 +0800
commit1add48a652ea695032d8c664fad3ea84afbfb9ea (patch)
tree1410f848aeaf32b61d7745999c85334275151338 /Types.cpp
parentfd1a01bbce5b5b6491e05b87fb183a55e9804f4e (diff)
downloaddexon-solidity-1add48a652ea695032d8c664fad3ea84afbfb9ea.tar.gz
dexon-solidity-1add48a652ea695032d8c664fad3ea84afbfb9ea.tar.zst
dexon-solidity-1add48a652ea695032d8c664fad3ea84afbfb9ea.zip
Copy routines for non-byte arrays.
Diffstat (limited to 'Types.cpp')
-rw-r--r--Types.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/Types.cpp b/Types.cpp
index 10a59826..ab93839d 100644
--- a/Types.cpp
+++ b/Types.cpp
@@ -721,9 +721,13 @@ bool ArrayType::isImplicitlyConvertibleTo(const Type& _convertTo) const
}
else
{
- // Require that the base type is the same, not only convertible.
- // This disallows assignment of nested arrays from storage to memory for now.
- if (*getBaseType() != *convertTo.getBaseType())
+ // Conversion to storage pointer or to memory, we de not copy element-for-element here, so
+ // require that the base type is the same, not only convertible.
+ // This disallows assignment of nested dynamic arrays from storage to memory for now.
+ if (
+ *copyForLocationIfReference(location(), getBaseType()) !=
+ *copyForLocationIfReference(location(), convertTo.getBaseType())
+ )
return false;
if (isDynamicallySized() != convertTo.isDynamicallySized())
return false;