diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2018-06-13 01:46:05 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-13 01:46:05 +0800 |
commit | 71dc4011702c2ba047553aec1aad8dbae5dcabe7 (patch) | |
tree | 2738d82fda74c3b7603d6136f6895197b0bac3bd /libsolidity | |
parent | d1e7e9ef5e3dfbf49045976da91a6a88dd28bbd3 (diff) | |
parent | 2084208dd3b304b14c9b4e180ea4c35fde324430 (diff) | |
download | dexon-solidity-71dc4011702c2ba047553aec1aad8dbae5dcabe7.tar.gz dexon-solidity-71dc4011702c2ba047553aec1aad8dbae5dcabe7.tar.zst dexon-solidity-71dc4011702c2ba047553aec1aad8dbae5dcabe7.zip |
Merge pull request #4280 from ethereum/disallow-sha3-suicide
[BREAKING] Disallow sha3 suicide
Diffstat (limited to 'libsolidity')
-rw-r--r-- | libsolidity/analysis/TypeChecker.cpp | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp index 521e8bd9..671e4030 100644 --- a/libsolidity/analysis/TypeChecker.cpp +++ b/libsolidity/analysis/TypeChecker.cpp @@ -1708,18 +1708,10 @@ bool TypeChecker::visit(FunctionCall const& _functionCall) if (auto functionName = dynamic_cast<Identifier const*>(&_functionCall.expression())) { - string msg; if (functionName->name() == "sha3" && functionType->kind() == FunctionType::Kind::SHA3) - msg = "\"sha3\" has been deprecated in favour of \"keccak256\""; + m_errorReporter.typeError(_functionCall.location(), "\"sha3\" has been deprecated in favour of \"keccak256\""); else if (functionName->name() == "suicide" && functionType->kind() == FunctionType::Kind::Selfdestruct) - msg = "\"suicide\" has been deprecated in favour of \"selfdestruct\""; - if (!msg.empty()) - { - if (v050) - m_errorReporter.typeError(_functionCall.location(), msg); - else - m_errorReporter.warning(_functionCall.location(), msg); - } + m_errorReporter.typeError(_functionCall.location(), "\"suicide\" has been deprecated in favour of \"selfdestruct\""); } if (!m_insideEmitStatement && functionType->kind() == FunctionType::Kind::Event) { |