aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2015-11-30 23:06:18 +0800
committerchriseth <c@ethdev.com>2015-11-30 23:06:18 +0800
commita8736b7b271dac117f15164cf4d2dfabcdd2c6fd (patch)
treefd868faadee1029f9466e98c8159f402c1921d1d /libsolidity
parenta3801be40c264296a6530d62141d96546b884190 (diff)
parentb97bb086de91e1f834e6e92cfdc8a985a6f761de (diff)
downloaddexon-solidity-a8736b7b271dac117f15164cf4d2dfabcdd2c6fd.tar.gz
dexon-solidity-a8736b7b271dac117f15164cf4d2dfabcdd2c6fd.tar.zst
dexon-solidity-a8736b7b271dac117f15164cf4d2dfabcdd2c6fd.zip
Merge pull request #256 from chriseth/selfdestruct
Introduce selfdestruct alias for suicide.
Diffstat (limited to 'libsolidity')
-rw-r--r--libsolidity/analysis/GlobalContext.cpp4
-rw-r--r--libsolidity/ast/Types.h2
-rw-r--r--libsolidity/codegen/ExpressionCompiler.cpp2
3 files changed, 5 insertions, 3 deletions
diff --git a/libsolidity/analysis/GlobalContext.cpp b/libsolidity/analysis/GlobalContext.cpp
index d519934d..a7ffcfad 100644
--- a/libsolidity/analysis/GlobalContext.cpp
+++ b/libsolidity/analysis/GlobalContext.cpp
@@ -39,7 +39,9 @@ m_magicVariables(vector<shared_ptr<MagicVariableDeclaration const>>{make_shared<
make_shared<MagicVariableDeclaration>("tx", make_shared<MagicType>(MagicType::Kind::Transaction)),
make_shared<MagicVariableDeclaration>("now", make_shared<IntegerType>(256)),
make_shared<MagicVariableDeclaration>("suicide",
- make_shared<FunctionType>(strings{"address"}, strings{}, FunctionType::Location::Suicide)),
+ make_shared<FunctionType>(strings{"address"}, strings{}, FunctionType::Location::Selfdestruct)),
+ make_shared<MagicVariableDeclaration>("selfdestruct",
+ make_shared<FunctionType>(strings{"address"}, strings{}, FunctionType::Location::Selfdestruct)),
make_shared<MagicVariableDeclaration>("addmod",
make_shared<FunctionType>(strings{"uint256", "uint256", "uint256"}, strings{"uint256"}, FunctionType::Location::AddMod)),
make_shared<MagicVariableDeclaration>("mulmod",
diff --git a/libsolidity/ast/Types.h b/libsolidity/ast/Types.h
index f841a1be..ea9bd198 100644
--- a/libsolidity/ast/Types.h
+++ b/libsolidity/ast/Types.h
@@ -739,7 +739,7 @@ public:
Creation, ///< external call using CREATE
Send, ///< CALL, but without data and gas
SHA3, ///< SHA3
- Suicide, ///< SUICIDE
+ Selfdestruct, ///< SELFDESTRUCT
ECRecover, ///< CALL to special contract for ecrecover
SHA256, ///< CALL to special contract for sha256
RIPEMD160, ///< CALL to special contract for ripemd160
diff --git a/libsolidity/codegen/ExpressionCompiler.cpp b/libsolidity/codegen/ExpressionCompiler.cpp
index 6c288ae7..d4140ae8 100644
--- a/libsolidity/codegen/ExpressionCompiler.cpp
+++ b/libsolidity/codegen/ExpressionCompiler.cpp
@@ -535,7 +535,7 @@ bool ExpressionCompiler::visit(FunctionCall const& _functionCall)
{}
);
break;
- case Location::Suicide:
+ case Location::Selfdestruct:
arguments.front()->accept(*this);
utils().convertType(*arguments.front()->annotation().type, *function.parameterTypes().front(), true);
m_context << eth::Instruction::SUICIDE;