mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Create.
This commit is contained in:
@@ -622,13 +622,21 @@ bool ExpressionCompiler::visit(FunctionCall const& _functionCall)
|
||||
else
|
||||
m_context << u256(0);
|
||||
m_context << Instruction::CREATE;
|
||||
solUnimplementedAssert(!_functionCall.annotation().tryCall, "");
|
||||
// Check if zero (out of stack or not enough balance).
|
||||
m_context << Instruction::DUP1 << Instruction::ISZERO;
|
||||
// TODO: Can we bubble up here? There might be different reasons for failure, I think.
|
||||
m_context.appendConditionalRevert(true);
|
||||
if (function.valueSet())
|
||||
m_context << swapInstruction(1) << Instruction::POP;
|
||||
// Check if zero (reverted)
|
||||
m_context << Instruction::DUP1 << Instruction::ISZERO;
|
||||
if (_functionCall.annotation().tryCall)
|
||||
{
|
||||
// If this is a try call, return "<address> 1" in the success case and
|
||||
// "0" in the error case.
|
||||
AssemblyItem errorCase = m_context.appendConditionalJump();
|
||||
m_context << u256(1);
|
||||
m_context << errorCase;
|
||||
}
|
||||
else
|
||||
// TODO: Can we bubble up here? There might be different reasons for failure, I think.
|
||||
m_context.appendConditionalRevert(true);
|
||||
break;
|
||||
}
|
||||
case FunctionType::Kind::SetGas:
|
||||
|
||||
Reference in New Issue
Block a user