mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Solidity STOPs in case of failed call.
This commit is contained in:
parent
a5b4f18dd7
commit
d8ddf59497
@ -984,9 +984,10 @@ void ExpressionCompiler::appendExternalFunctionCall(FunctionType const& _functio
|
||||
m_context << eth::dupInstruction(m_context.baseToCurrentStackOffset(gasStackPos));
|
||||
else
|
||||
// send all gas except for the 21 needed to execute "SUB" and "CALL"
|
||||
m_context << u256(21) << eth::Instruction::GAS << eth::Instruction::SUB;
|
||||
m_context << eth::Instruction::CALL
|
||||
<< eth::Instruction::POP; // @todo do not ignore failure indicator
|
||||
m_context << u256(_functionType.valueSet() ? 6741 : 41) << eth::Instruction::GAS << eth::Instruction::SUB;
|
||||
m_context << eth::Instruction::CALL;
|
||||
auto tag = m_context.appendConditionalJump();
|
||||
m_context << eth::Instruction::STOP << tag; // STOP if CALL leaves 0.
|
||||
if (_functionType.valueSet())
|
||||
m_context << eth::Instruction::POP;
|
||||
if (_functionType.gasSet())
|
||||
@ -999,10 +1000,12 @@ void ExpressionCompiler::appendExternalFunctionCall(FunctionType const& _functio
|
||||
CompilerUtils(m_context).loadFromMemory(0, *firstType, false, true);
|
||||
}
|
||||
|
||||
void ExpressionCompiler::appendArgumentsCopyToMemory(vector<ASTPointer<Expression const>> const& _arguments,
|
||||
void ExpressionCompiler::appendArgumentsCopyToMemory(
|
||||
vector<ASTPointer<Expression const>> const& _arguments,
|
||||
TypePointers const& _types,
|
||||
bool _padToWordBoundaries,
|
||||
bool _padExceptionIfFourBytes)
|
||||
bool _padExceptionIfFourBytes
|
||||
)
|
||||
{
|
||||
solAssert(_types.empty() || _types.size() == _arguments.size(), "");
|
||||
for (size_t i = 0; i < _arguments.size(); ++i)
|
||||
|
Loading…
Reference in New Issue
Block a user