mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Add option member for function type.
This commit is contained in:
@@ -780,6 +780,7 @@ bool ExpressionCompiler::visit(FunctionCall const& _functionCall)
|
||||
break;
|
||||
case FunctionType::Kind::Send:
|
||||
case FunctionType::Kind::Transfer:
|
||||
{
|
||||
_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.
|
||||
@@ -788,6 +789,9 @@ bool ExpressionCompiler::visit(FunctionCall const& _functionCall)
|
||||
// gas <- gas * !value
|
||||
m_context << Instruction::SWAP1 << Instruction::DUP2;
|
||||
m_context << Instruction::ISZERO << Instruction::MUL << Instruction::SWAP1;
|
||||
FunctionType::Options callOptions;
|
||||
callOptions.valueSet = true;
|
||||
callOptions.gasSet = true;
|
||||
appendExternalFunctionCall(
|
||||
FunctionType(
|
||||
TypePointers{},
|
||||
@@ -795,11 +799,9 @@ bool ExpressionCompiler::visit(FunctionCall const& _functionCall)
|
||||
strings(),
|
||||
strings(),
|
||||
FunctionType::Kind::BareCall,
|
||||
false,
|
||||
StateMutability::NonPayable,
|
||||
nullptr,
|
||||
true,
|
||||
true
|
||||
callOptions
|
||||
),
|
||||
{},
|
||||
false
|
||||
@@ -812,6 +814,7 @@ bool ExpressionCompiler::visit(FunctionCall const& _functionCall)
|
||||
m_context.appendConditionalRevert(true);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case FunctionType::Kind::Selfdestruct:
|
||||
acceptAndConvert(*arguments.front(), *function.parameterTypes().front(), true);
|
||||
m_context << Instruction::SELFDESTRUCT;
|
||||
|
||||
Reference in New Issue
Block a user