aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity
diff options
context:
space:
mode:
Diffstat (limited to 'libsolidity')
-rw-r--r--libsolidity/analysis/TypeChecker.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp
index 56f9c764..29db7441 100644
--- a/libsolidity/analysis/TypeChecker.cpp
+++ b/libsolidity/analysis/TypeChecker.cpp
@@ -586,7 +586,11 @@ bool TypeChecker::visit(VariableDeclaration const& _variable)
if (varType->category() == Type::Category::Array)
if (auto arrayType = dynamic_cast<ArrayType const*>(varType.get()))
- if ((arrayType->location() == DataLocation::CallData) && !arrayType->validForCalldata())
+ if (
+ ((arrayType->location() == DataLocation::Memory) ||
+ (arrayType->location() == DataLocation::CallData)) &&
+ !arrayType->validForCalldata()
+ )
m_errorReporter.typeError(_variable.location(), "Array is too large to be encoded as calldata.");
return false;