Fixed internal error related to ecrecover and ABIEncoderV2.

This commit is contained in:
chriseth
2019-02-19 14:17:03 +01:00
parent 8607690a30
commit 05541e5adb
3 changed files with 26 additions and 1 deletions
+6 -1
View File
@@ -1967,12 +1967,17 @@ void ExpressionCompiler::appendExternalFunctionCall(
// If the function takes arbitrary parameters or is a bare call, copy dynamic length data in place.
// Move arguments to memory, will not update the free memory pointer (but will update the memory
// pointer on the stack).
bool encodeInPlace = _functionType.takesArbitraryParameters() || _functionType.isBareCall();
if (_functionType.kind() == FunctionType::Kind::ECRecover)
// This would be the only combination of padding and in-place encoding,
// but all parameters of ecrecover are value types anyway.
encodeInPlace = false;
bool encodeForLibraryCall = funKind == FunctionType::Kind::DelegateCall;
utils().encodeToMemory(
argumentTypes,
parameterTypes,
_functionType.padArguments(),
_functionType.takesArbitraryParameters() || _functionType.isBareCall(),
encodeInPlace,
encodeForLibraryCall
);