mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Move msg.gas to global function gasleft(). Closes #2971.
This commit is contained in:
@@ -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)
|
||||
{
|
||||
const bool 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();
|
||||
@@ -1135,7 +1140,7 @@ bool ExpressionCompiler::visit(MemberAccess const& _memberAccess)
|
||||
m_context << Instruction::CALLVALUE;
|
||||
else if (member == "origin")
|
||||
m_context << Instruction::ORIGIN;
|
||||
else if (member == "gas")
|
||||
else if (!v050 && member == "gas")
|
||||
m_context << Instruction::GAS;
|
||||
else if (member == "gasprice")
|
||||
m_context << Instruction::GASPRICE;
|
||||
|
||||
Reference in New Issue
Block a user