aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Compiler.cpp2
-rw-r--r--ExpressionCompiler.cpp18
-rw-r--r--ExpressionCompiler.h6
3 files changed, 7 insertions, 19 deletions
diff --git a/Compiler.cpp b/Compiler.cpp
index 26147340..93d786be 100644
--- a/Compiler.cpp
+++ b/Compiler.cpp
@@ -193,7 +193,7 @@ void Compiler::appendFunctionSelector(ContractDefinition const& _contract)
appendReturnValuePacker(FunctionType(*fallback).getReturnParameterTypes());
}
else
- m_context.appendConditionalJumpTo(m_context.errorTag()); // function not found
+ m_context << eth::Instruction::STOP; // function not found
for (auto const& it: interfaceFunctions)
{
FunctionTypePointer const& functionType = it.second;
diff --git a/ExpressionCompiler.cpp b/ExpressionCompiler.cpp
index e8ac8ff8..d618c631 100644
--- a/ExpressionCompiler.cpp
+++ b/ExpressionCompiler.cpp
@@ -534,8 +534,7 @@ bool ExpressionCompiler::visit(FunctionCall const& _functionCall)
true,
true
),
- {},
- true
+ {}
);
break;
case Location::Suicide:
@@ -1035,8 +1034,8 @@ void ExpressionCompiler::appendHighBitsCleanup(IntegerType const& _typeOnStack)
void ExpressionCompiler::appendExternalFunctionCall(
FunctionType const& _functionType,
- vector<ASTPointer<Expression const>> const& _arguments,
- bool isSend)
+ vector<ASTPointer<Expression const>> const& _arguments
+ )
{
solAssert(_functionType.takesArbitraryParameters() ||
_arguments.size() == _functionType.getParameterTypes().size(), "");
@@ -1106,15 +1105,8 @@ void ExpressionCompiler::appendExternalFunctionCall(
m_context << eth::Instruction::CALL;
//Propagate error condition (if CALL pushes 0 on stack).
- if (!isSend)
- {
- m_context << eth::Instruction::ISZERO;
- m_context.appendConditionalJumpTo(m_context.errorTag());
- } else
- {
- auto tag = m_context.appendConditionalJump();
- m_context << eth::Instruction::STOP << tag;
- }
+ auto tag = m_context.appendConditionalJump();
+ m_context << eth::Instruction::STOP << tag; // STOP if CALL leaves 0.// }
if (_functionType.valueSet())
m_context << eth::Instruction::POP;
diff --git a/ExpressionCompiler.h b/ExpressionCompiler.h
index 6f47762b..174e16d8 100644
--- a/ExpressionCompiler.h
+++ b/ExpressionCompiler.h
@@ -98,11 +98,7 @@ private:
void appendHighBitsCleanup(IntegerType const& _typeOnStack);
/// Appends code to call a function of the given type with the given arguments.
- void appendExternalFunctionCall(
- FunctionType const& _functionType,
- std::vector<ASTPointer<Expression const>> const& _arguments,
- bool isSend = false
- );
+ void appendExternalFunctionCall(FunctionType const& _functionType, std::vector<ASTPointer<Expression const>> const& _arguments);
/// 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
/// this call. If @a _padToWordBoundaries is set to false, all values are concatenated without