mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Support copying dynamically encoded structs from calldata to memory.
This commit is contained in:
@@ -1106,11 +1106,22 @@ void CompilerUtils::convertType(
|
||||
}
|
||||
case DataLocation::CallData:
|
||||
{
|
||||
solUnimplementedAssert(!typeOnStack.isDynamicallyEncoded(), "");
|
||||
m_context << Instruction::DUP1;
|
||||
m_context << Instruction::CALLDATASIZE;
|
||||
m_context << Instruction::SUB;
|
||||
abiDecode({&targetType}, false);
|
||||
if (typeOnStack.isDynamicallyEncoded())
|
||||
{
|
||||
solAssert(m_context.useABICoderV2(), "");
|
||||
m_context.callYulFunction(
|
||||
m_context.utilFunctions().conversionFunction(typeOnStack, targetType),
|
||||
1,
|
||||
1
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_context << Instruction::DUP1;
|
||||
m_context << Instruction::CALLDATASIZE;
|
||||
m_context << Instruction::SUB;
|
||||
abiDecode({&targetType}, false);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case DataLocation::Memory:
|
||||
|
||||
Reference in New Issue
Block a user