diff options
author | Leonardo Alt <leo@ethereum.org> | 2018-08-15 18:30:29 +0800 |
---|---|---|
committer | Leonardo Alt <leo@ethereum.org> | 2018-08-15 23:11:18 +0800 |
commit | b6c839e817a35d51f44847558b8f1f4cf0ec1737 (patch) | |
tree | 36619b7e903dc51d40acb5a4ccdcaeec90fb7c5f /libsolidity/analysis | |
parent | 2ed793c4d345de909332651145265a21a04e92d1 (diff) | |
download | dexon-solidity-b6c839e817a35d51f44847558b8f1f4cf0ec1737.tar.gz dexon-solidity-b6c839e817a35d51f44847558b8f1f4cf0ec1737.tar.zst dexon-solidity-b6c839e817a35d51f44847558b8f1f4cf0ec1737.zip |
Disallow indexed reference types in events when using ABIEncoderV2
Diffstat (limited to 'libsolidity/analysis')
-rw-r--r-- | libsolidity/analysis/TypeChecker.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp index 43e894e5..b1ab6f97 100644 --- a/libsolidity/analysis/TypeChecker.cpp +++ b/libsolidity/analysis/TypeChecker.cpp @@ -895,7 +895,17 @@ bool TypeChecker::visit(EventDefinition const& _eventDef) for (ASTPointer<VariableDeclaration> const& var: _eventDef.parameters()) { if (var->isIndexed()) + { numIndexed++; + if ( + _eventDef.sourceUnit().annotation().experimentalFeatures.count(ExperimentalFeature::ABIEncoderV2) + && dynamic_cast<ReferenceType const*>(type(*var).get()) + ) + m_errorReporter.typeError( + var->location(), + "Reference types cannot be indexed." + ); + } if (!type(*var)->canLiveOutsideStorage()) m_errorReporter.typeError(var->location(), "Type is required to live outside storage."); if (!type(*var)->interfaceType(false)) |