diff options
author | chriseth <chris@ethereum.org> | 2018-08-16 06:13:21 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-16 06:13:21 +0800 |
commit | cc6fa6d61fb934617d088bb04766ef0dea614b4f (patch) | |
tree | 3256618e2b268924442ea55e45622313969bad80 /libsolidity/analysis | |
parent | c164f80ba6b1c6753450b59365d1e0f1633688db (diff) | |
parent | db48925907ef4b31025f83ca83298483c4860583 (diff) | |
download | dexon-solidity-cc6fa6d61fb934617d088bb04766ef0dea614b4f.tar.gz dexon-solidity-cc6fa6d61fb934617d088bb04766ef0dea614b4f.tar.zst dexon-solidity-cc6fa6d61fb934617d088bb04766ef0dea614b4f.zip |
Merge pull request #4822 from ethereum/addressStaticCall
Add ``staticcall`` to ``address``.
Diffstat (limited to 'libsolidity/analysis')
-rw-r--r-- | libsolidity/analysis/TypeChecker.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp index c737fe41..5033fd63 100644 --- a/libsolidity/analysis/TypeChecker.cpp +++ b/libsolidity/analysis/TypeChecker.cpp @@ -1369,7 +1369,8 @@ void TypeChecker::endVisit(ExpressionStatement const& _statement) if ( kind == FunctionType::Kind::BareCall || kind == FunctionType::Kind::BareCallCode || - kind == FunctionType::Kind::BareDelegateCall + kind == FunctionType::Kind::BareDelegateCall || + kind == FunctionType::Kind::BareStaticCall ) m_errorReporter.warning(_statement.location(), "Return value of low-level calls not used."); else if (kind == FunctionType::Kind::Send) @@ -1764,6 +1765,9 @@ bool TypeChecker::visit(FunctionCall const& _functionCall) return false; } + if (functionType->kind() == FunctionType::Kind::BareStaticCall && !m_evmVersion.hasStaticCall()) + m_errorReporter.typeError(_functionCall.location(), "\"staticcall\" is not supported by the VM version."); + auto returnTypes = allowDynamicTypes ? functionType->returnParameterTypes() : @@ -1844,7 +1848,8 @@ bool TypeChecker::visit(FunctionCall const& _functionCall) else if ( functionType->kind() == FunctionType::Kind::BareCall || functionType->kind() == FunctionType::Kind::BareCallCode || - functionType->kind() == FunctionType::Kind::BareDelegateCall + functionType->kind() == FunctionType::Kind::BareDelegateCall || + functionType->kind() == FunctionType::Kind::BareStaticCall ) { if (arguments.empty()) @@ -1892,7 +1897,8 @@ bool TypeChecker::visit(FunctionCall const& _functionCall) if ( functionType->kind() == FunctionType::Kind::BareCall || functionType->kind() == FunctionType::Kind::BareCallCode || - functionType->kind() == FunctionType::Kind::BareDelegateCall + functionType->kind() == FunctionType::Kind::BareDelegateCall || + functionType->kind() == FunctionType::Kind::BareStaticCall ) msg += " This function requires a single bytes argument. If all your arguments are value types, you can use abi.encode(...) to properly generate it."; else if ( |