Ensure that public callable parameters are valid for calldata.

This commit is contained in:
Daniel Kirchner
2020-04-16 17:23:20 +02:00
parent 6093982606
commit f6d1cee06b
5 changed files with 19 additions and 1 deletions
+2
View File
@@ -488,6 +488,8 @@ bool TypeChecker::visit(VariableDeclaration const& _variable)
if (auto referenceType = dynamic_cast<ReferenceType const*>(varType))
{
auto result = referenceType->validForLocation(referenceType->location());
if (result && _variable.isPublicCallableParameter())
result = referenceType->validForLocation(DataLocation::CallData);
if (!result)
{
solAssert(!result.message().empty(), "Expected detailed error message");