Refactor.

This commit is contained in:
chriseth
2019-09-18 14:06:03 +02:00
parent 51cde26fb1
commit 9ecd51c54d
3 changed files with 25 additions and 18 deletions
+1 -18
View File
@@ -2189,24 +2189,7 @@ void ExpressionCompiler::appendExternalFunctionCall(
// an internal helper function e.g. for ``send`` and ``transfer``. In that
// case we're only interested in the success condition, not the return data.
if (!_functionType.returnParameterTypes().empty())
{
if (haveReturndatacopy)
{
m_context << Instruction::RETURNDATASIZE;
m_context.appendInlineAssembly(R"({
switch v case 0 {
v := 0x60
} default {
v := mload(0x40)
mstore(0x40, add(v, and(add(returndatasize(), 0x3f), not(0x1f))))
mstore(v, returndatasize())
returndatacopy(add(v, 0x20), 0, returndatasize())
}
})", {"v"});
}
else
utils().pushZeroPointer();
}
utils().returnDataToArray();
}
else if (funKind == FunctionType::Kind::RIPEMD160)
{