diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2018-06-13 00:06:47 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2018-06-13 01:16:18 +0800 |
commit | 9de45383d81c666deba27162ce163fc1c8c852dc (patch) | |
tree | 9a3983c7b62802179a044b822d1b687a9e38da2b /libsolidity | |
parent | 0e23b5e9547e69db0719ebf4cada3f49a011fe8e (diff) | |
download | dexon-solidity-9de45383d81c666deba27162ce163fc1c8c852dc.tar dexon-solidity-9de45383d81c666deba27162ce163fc1c8c852dc.tar.gz dexon-solidity-9de45383d81c666deba27162ce163fc1c8c852dc.tar.bz2 dexon-solidity-9de45383d81c666deba27162ce163fc1c8c852dc.tar.lz dexon-solidity-9de45383d81c666deba27162ce163fc1c8c852dc.tar.xz dexon-solidity-9de45383d81c666deba27162ce163fc1c8c852dc.tar.zst dexon-solidity-9de45383d81c666deba27162ce163fc1c8c852dc.zip |
Disallow sha3/suicide aliases
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) { |