diff options
author | Daniel Kirchner <daniel@ekpyron.org> | 2018-08-15 20:40:20 +0800 |
---|---|---|
committer | chriseth <chris@ethereum.org> | 2018-08-15 22:06:48 +0800 |
commit | 7ca0aaaf6f62aafd0fe36ae6b7dc777361ae40e3 (patch) | |
tree | 95019017cb653af8109ca7ac0b5f4216103eae3f /libsolidity/analysis | |
parent | 2ed793c4d345de909332651145265a21a04e92d1 (diff) | |
download | dexon-solidity-7ca0aaaf6f62aafd0fe36ae6b7dc777361ae40e3.tar dexon-solidity-7ca0aaaf6f62aafd0fe36ae6b7dc777361ae40e3.tar.gz dexon-solidity-7ca0aaaf6f62aafd0fe36ae6b7dc777361ae40e3.tar.bz2 dexon-solidity-7ca0aaaf6f62aafd0fe36ae6b7dc777361ae40e3.tar.lz dexon-solidity-7ca0aaaf6f62aafd0fe36ae6b7dc777361ae40e3.tar.xz dexon-solidity-7ca0aaaf6f62aafd0fe36ae6b7dc777361ae40e3.tar.zst dexon-solidity-7ca0aaaf6f62aafd0fe36ae6b7dc777361ae40e3.zip |
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 43e894e5..8d6da28b 100644 --- a/libsolidity/analysis/TypeChecker.cpp +++ b/libsolidity/analysis/TypeChecker.cpp @@ -1359,7 +1359,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) @@ -1754,6 +1755,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() : @@ -1834,7 +1838,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()) @@ -1882,7 +1887,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 ( |