diff options
author | Daniel Kirchner <daniel@ekpyron.org> | 2018-03-06 06:13:51 +0800 |
---|---|---|
committer | Daniel Kirchner <daniel@ekpyron.org> | 2018-03-06 06:16:26 +0800 |
commit | 91b13b734d34e6bb5a76fb53624588d035946237 (patch) | |
tree | c0fe84429572c32cffda17009d350f7ddd6cbda7 /libsolidity/ast | |
parent | 2213f9946b34a6e8f5604a6b821d31788dcee08b (diff) | |
download | dexon-solidity-91b13b734d34e6bb5a76fb53624588d035946237.tar.gz dexon-solidity-91b13b734d34e6bb5a76fb53624588d035946237.tar.zst dexon-solidity-91b13b734d34e6bb5a76fb53624588d035946237.zip |
Use StaticAnalyzer to deprecate msg.gas instead of conditionally removing it in MagicType.
Diffstat (limited to 'libsolidity/ast')
-rw-r--r-- | libsolidity/ast/Types.cpp | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/libsolidity/ast/Types.cpp b/libsolidity/ast/Types.cpp index 26bde1c4..771ae643 100644 --- a/libsolidity/ast/Types.cpp +++ b/libsolidity/ast/Types.cpp @@ -3000,10 +3000,8 @@ bool MagicType::operator==(Type const& _other) const return other.m_kind == m_kind; } -MemberList::MemberMap MagicType::nativeMembers(ContractDefinition const* _contract) const +MemberList::MemberMap MagicType::nativeMembers(ContractDefinition const*) const { - solAssert(_contract, ""); - const bool v050 = _contract->sourceUnit().annotation().experimentalFeatures.count(ExperimentalFeature::V050); switch (m_kind) { case Kind::Block: @@ -3016,17 +3014,13 @@ MemberList::MemberMap MagicType::nativeMembers(ContractDefinition const* _contra {"gaslimit", make_shared<IntegerType>(256)} }); case Kind::Message: - { - std::vector<MemberList::Member> members = { + return MemberList::MemberMap({ {"sender", make_shared<IntegerType>(160, IntegerType::Modifier::Address)}, + {"gas", make_shared<IntegerType>(256)}, {"value", make_shared<IntegerType>(256)}, {"data", make_shared<ArrayType>(DataLocation::CallData)}, {"sig", make_shared<FixedBytesType>(4)} - }; - if (!v050) - members.emplace_back("gas", make_shared<IntegerType>(256)); - return members; - } + }); case Kind::Transaction: return MemberList::MemberMap({ {"origin", make_shared<IntegerType>(160, IntegerType::Modifier::Address)}, |