aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/analysis
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-07-11 19:37:34 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2017-07-12 16:48:44 +0800
commitdb7ad508f8ad33389ae507967aebc05aaf31b94b (patch)
treecb36442efdde7fffc045ca4f87f7635d6e976b94 /libsolidity/analysis
parent699a3724ae57168578dbc9844ca20c4af1ed7bcf (diff)
downloaddexon-solidity-db7ad508f8ad33389ae507967aebc05aaf31b94b.tar.gz
dexon-solidity-db7ad508f8ad33389ae507967aebc05aaf31b94b.tar.zst
dexon-solidity-db7ad508f8ad33389ae507967aebc05aaf31b94b.zip
Issue proper warning trying to access calldata variables in inline assembly
Diffstat (limited to 'libsolidity/analysis')
-rw-r--r--libsolidity/analysis/TypeChecker.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp
index 7306a36d..90043b43 100644
--- a/libsolidity/analysis/TypeChecker.cpp
+++ b/libsolidity/analysis/TypeChecker.cpp
@@ -723,7 +723,10 @@ bool TypeChecker::visit(InlineAssembly const& _inlineAssembly)
}
else if (var->type()->sizeOnStack() != 1)
{
- m_errorReporter.typeError(_identifier.location, "Only types that use one stack slot are supported.");
+ if (var->type()->dataStoredIn(DataLocation::CallData))
+ m_errorReporter.typeError(_identifier.location, "Call data elements cannot be accessed directly. Copy to a local variable first or use \"calldataload\" or \"calldatacopy\" with manually determined offsets and sizes.");
+ else
+ m_errorReporter.typeError(_identifier.location, "Only types that use one stack slot are supported.");
return size_t(-1);
}
}