diff options
author | chriseth <c@ethdev.com> | 2016-11-09 22:14:16 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2016-11-16 21:37:18 +0800 |
commit | 925d6741466a423b58cb519b6cc400863426607e (patch) | |
tree | 1b82670259db05e74277e033cb3a0117e6125dd8 /libsolidity/analysis/ReferencesResolver.cpp | |
parent | f7a62c1e69e98cc612b7ed98497260b38234a162 (diff) | |
download | dexon-solidity-925d6741466a423b58cb519b6cc400863426607e.tar.gz dexon-solidity-925d6741466a423b58cb519b6cc400863426607e.tar.zst dexon-solidity-925d6741466a423b58cb519b6cc400863426607e.zip |
Disallow payable internal functions.
Diffstat (limited to 'libsolidity/analysis/ReferencesResolver.cpp')
-rw-r--r-- | libsolidity/analysis/ReferencesResolver.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libsolidity/analysis/ReferencesResolver.cpp b/libsolidity/analysis/ReferencesResolver.cpp index 41cad922..c49af013 100644 --- a/libsolidity/analysis/ReferencesResolver.cpp +++ b/libsolidity/analysis/ReferencesResolver.cpp @@ -95,7 +95,8 @@ void ReferencesResolver::endVisit(FunctionTypeName const& _typeName) typeError(_typeName.location(), "Invalid visibility, can only be \"external\" or \"internal\"."); } - // Do we allow storage references for external functions? + if (_typeName.isPayable() && _typeName.visibility() != VariableDeclaration::Visibility::External) + fatalTypeError(_typeName.location(), "Only external function types can be payable."); _typeName.annotation().type = make_shared<FunctionType>(_typeName); } |