aboutsummaryrefslogtreecommitdiffstats
path: root/CompilerUtils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'CompilerUtils.cpp')
-rw-r--r--CompilerUtils.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/CompilerUtils.cpp b/CompilerUtils.cpp
index e62f59e2..49247581 100644
--- a/CompilerUtils.cpp
+++ b/CompilerUtils.cpp
@@ -404,7 +404,7 @@ void CompilerUtils::convertType(Type const& _typeOnStack, Type const& _targetTyp
case DataLocation::Storage:
// Other cases are done explicitly in LValue::storeValue, and only possible by assignment.
solAssert(
- targetType.isPointer() &&
+ (targetType.isPointer() || (typeOnStack.isByteArray() && targetType.isByteArray())) &&
typeOnStack.location() == DataLocation::Storage,
"Invalid conversion to storage type."
);
@@ -469,6 +469,13 @@ void CompilerUtils::convertType(Type const& _typeOnStack, Type const& _targetTyp
}
break;
}
+ case DataLocation::CallData:
+ solAssert(
+ targetType.isByteArray() &&
+ typeOnStack.isByteArray() &&
+ typeOnStack.location() == DataLocation::CallData,
+ "Invalid conversion to calldata type.");
+ break;
default:
solAssert(
false,