diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2017-08-01 03:31:12 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2017-09-19 18:11:19 +0800 |
commit | ed1fd49ab07de1ddad9f3bc2864e17fe21ed993d (patch) | |
tree | 57f605da80c31affda99ddd7fc1b1ca359535b36 /libsolidity | |
parent | 1fc71bd75841850ee04d151e9bfbf938928b276a (diff) | |
download | dexon-solidity-ed1fd49ab07de1ddad9f3bc2864e17fe21ed993d.tar dexon-solidity-ed1fd49ab07de1ddad9f3bc2864e17fe21ed993d.tar.gz dexon-solidity-ed1fd49ab07de1ddad9f3bc2864e17fe21ed993d.tar.bz2 dexon-solidity-ed1fd49ab07de1ddad9f3bc2864e17fe21ed993d.tar.lz dexon-solidity-ed1fd49ab07de1ddad9f3bc2864e17fe21ed993d.tar.xz dexon-solidity-ed1fd49ab07de1ddad9f3bc2864e17fe21ed993d.tar.zst dexon-solidity-ed1fd49ab07de1ddad9f3bc2864e17fe21ed993d.zip |
Warn about obsolete sha3/suicide calls
Diffstat (limited to 'libsolidity')
-rw-r--r-- | libsolidity/analysis/TypeChecker.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp index 40add37e..4b2ec8d6 100644 --- a/libsolidity/analysis/TypeChecker.cpp +++ b/libsolidity/analysis/TypeChecker.cpp @@ -1477,6 +1477,14 @@ bool TypeChecker::visit(FunctionCall const& _functionCall) else _functionCall.annotation().type = make_shared<TupleType>(functionType->returnParameterTypes()); + if (auto functionName = dynamic_cast<Identifier const*>(&_functionCall.expression())) + { + if (functionName->name() == "sha3" && functionType->kind() == FunctionType::Kind::SHA3) + m_errorReporter.warning(_functionCall.location(), "\"sha3\" has been deprecated in favour of \"keccak256\""); + else if (functionName->name() == "suicide" && functionType->kind() == FunctionType::Kind::Selfdestruct) + m_errorReporter.warning(_functionCall.location(), "\"suicide\" has been deprecated in favour of \"selfdestruct\""); + } + TypePointers parameterTypes = functionType->parameterTypes(); if (!functionType->padArguments()) |