Support gas modifier on addr.transfer()

This commit is contained in:
Alex Beregszaszi
2017-02-24 00:18:18 +00:00
parent ba437ef31a
commit 81006dae98
3 changed files with 10 additions and 2 deletions
+2 -1
View File
@@ -2315,9 +2315,10 @@ MemberList::MemberMap FunctionType::nativeMembers(ContractDefinition const*) con
case Location::Bare:
case Location::BareCallCode:
case Location::BareDelegateCall:
case Location::Transfer:
{
MemberList::MemberMap members;
if (m_location != Location::BareDelegateCall && m_location != Location::DelegateCall)
if (m_location != Location::BareDelegateCall && m_location != Location::DelegateCall && m_location != Location::Transfer)
{
if (m_isPayable)
members.push_back(MemberList::Member(
+2 -1
View File
@@ -620,7 +620,8 @@ bool ExpressionCompiler::visit(FunctionCall const& _functionCall)
_functionCall.expression().accept(*this);
// Provide the gas stipend manually at first because we may send zero ether.
// Will be zeroed if we send more than zero ether.
m_context << u256(eth::GasCosts::callStipend);
if (!function.gasSet())
m_context << u256(eth::GasCosts::callStipend);
arguments.front()->accept(*this);
utils().convertType(
*arguments.front()->annotation().type,