diff options
author | chriseth <chris@ethereum.org> | 2018-03-06 03:11:37 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-06 03:11:37 +0800 |
commit | 3793aa405b9326c7269ed001344d721ae05629e8 (patch) | |
tree | 2657e731bf0f2a6c608ffefcdb3d5731b3e77fe0 /libsolidity/codegen/ExpressionCompiler.cpp | |
parent | f190b274313131bbc939815a00d49dcd2c3de10d (diff) | |
parent | 2213f9946b34a6e8f5604a6b821d31788dcee08b (diff) | |
download | dexon-solidity-3793aa405b9326c7269ed001344d721ae05629e8.tar.gz dexon-solidity-3793aa405b9326c7269ed001344d721ae05629e8.tar.zst dexon-solidity-3793aa405b9326c7269ed001344d721ae05629e8.zip |
Merge pull request #3643 from ethereum/gasleft
Move msg.gas to global function gasleft(). Closes #2971.
Diffstat (limited to 'libsolidity/codegen/ExpressionCompiler.cpp')
-rw-r--r-- | libsolidity/codegen/ExpressionCompiler.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libsolidity/codegen/ExpressionCompiler.cpp b/libsolidity/codegen/ExpressionCompiler.cpp index 12881d63..a56b11eb 100644 --- a/libsolidity/codegen/ExpressionCompiler.cpp +++ b/libsolidity/codegen/ExpressionCompiler.cpp @@ -906,6 +906,9 @@ bool ExpressionCompiler::visit(FunctionCall const& _functionCall) m_context << success; break; } + case FunctionType::Kind::GasLeft: + m_context << Instruction::GAS; + break; default: solAssert(false, "Invalid function type."); } @@ -921,6 +924,8 @@ bool ExpressionCompiler::visit(NewExpression const&) bool ExpressionCompiler::visit(MemberAccess const& _memberAccess) { + bool const v050 = m_context.experimentalFeatureActive(ExperimentalFeature::V050); + CompilerContext::LocationSetter locationSetter(m_context, _memberAccess); // Check whether the member is a bound function. ASTString const& member = _memberAccess.memberName(); @@ -1136,7 +1141,10 @@ bool ExpressionCompiler::visit(MemberAccess const& _memberAccess) else if (member == "origin") m_context << Instruction::ORIGIN; else if (member == "gas") + { + solAssert(!v050, ""); m_context << Instruction::GAS; + } else if (member == "gasprice") m_context << Instruction::GASPRICE; else if (member == "data") |