mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
removed exception when function is not found
This commit is contained in:
parent
e72a014cf4
commit
ccb194fd39
@ -193,7 +193,7 @@ void Compiler::appendFunctionSelector(ContractDefinition const& _contract)
|
|||||||
appendReturnValuePacker(FunctionType(*fallback).getReturnParameterTypes());
|
appendReturnValuePacker(FunctionType(*fallback).getReturnParameterTypes());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
m_context.appendConditionalJumpTo(m_context.errorTag()); // function not found
|
m_context << eth::Instruction::STOP; // function not found
|
||||||
for (auto const& it: interfaceFunctions)
|
for (auto const& it: interfaceFunctions)
|
||||||
{
|
{
|
||||||
FunctionTypePointer const& functionType = it.second;
|
FunctionTypePointer const& functionType = it.second;
|
||||||
|
@ -534,8 +534,7 @@ bool ExpressionCompiler::visit(FunctionCall const& _functionCall)
|
|||||||
true,
|
true,
|
||||||
true
|
true
|
||||||
),
|
),
|
||||||
{},
|
{}
|
||||||
true
|
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
case Location::Suicide:
|
case Location::Suicide:
|
||||||
@ -1035,8 +1034,8 @@ void ExpressionCompiler::appendHighBitsCleanup(IntegerType const& _typeOnStack)
|
|||||||
|
|
||||||
void ExpressionCompiler::appendExternalFunctionCall(
|
void ExpressionCompiler::appendExternalFunctionCall(
|
||||||
FunctionType const& _functionType,
|
FunctionType const& _functionType,
|
||||||
vector<ASTPointer<Expression const>> const& _arguments,
|
vector<ASTPointer<Expression const>> const& _arguments
|
||||||
bool isSend)
|
)
|
||||||
{
|
{
|
||||||
solAssert(_functionType.takesArbitraryParameters() ||
|
solAssert(_functionType.takesArbitraryParameters() ||
|
||||||
_arguments.size() == _functionType.getParameterTypes().size(), "");
|
_arguments.size() == _functionType.getParameterTypes().size(), "");
|
||||||
@ -1106,15 +1105,8 @@ void ExpressionCompiler::appendExternalFunctionCall(
|
|||||||
m_context << eth::Instruction::CALL;
|
m_context << eth::Instruction::CALL;
|
||||||
|
|
||||||
//Propagate error condition (if CALL pushes 0 on stack).
|
//Propagate error condition (if CALL pushes 0 on stack).
|
||||||
if (!isSend)
|
auto tag = m_context.appendConditionalJump();
|
||||||
{
|
m_context << eth::Instruction::STOP << tag; // STOP if CALL leaves 0.// }
|
||||||
m_context << eth::Instruction::ISZERO;
|
|
||||||
m_context.appendConditionalJumpTo(m_context.errorTag());
|
|
||||||
} else
|
|
||||||
{
|
|
||||||
auto tag = m_context.appendConditionalJump();
|
|
||||||
m_context << eth::Instruction::STOP << tag;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_functionType.valueSet())
|
if (_functionType.valueSet())
|
||||||
m_context << eth::Instruction::POP;
|
m_context << eth::Instruction::POP;
|
||||||
|
@ -98,11 +98,7 @@ private:
|
|||||||
void appendHighBitsCleanup(IntegerType const& _typeOnStack);
|
void appendHighBitsCleanup(IntegerType const& _typeOnStack);
|
||||||
|
|
||||||
/// Appends code to call a function of the given type with the given arguments.
|
/// Appends code to call a function of the given type with the given arguments.
|
||||||
void appendExternalFunctionCall(
|
void appendExternalFunctionCall(FunctionType const& _functionType, std::vector<ASTPointer<Expression const>> const& _arguments);
|
||||||
FunctionType const& _functionType,
|
|
||||||
std::vector<ASTPointer<Expression const>> const& _arguments,
|
|
||||||
bool isSend = false
|
|
||||||
);
|
|
||||||
/// Appends code that evaluates the given arguments and moves the result to memory encoded as
|
/// Appends code that evaluates the given arguments and moves the result to memory encoded as
|
||||||
/// specified by the ABI. The memory offset is expected to be on the stack and is updated by
|
/// specified by the ABI. The memory offset is expected to be on the stack and is updated by
|
||||||
/// this call. If @a _padToWordBoundaries is set to false, all values are concatenated without
|
/// this call. If @a _padToWordBoundaries is set to false, all values are concatenated without
|
||||||
|
Loading…
Reference in New Issue
Block a user