mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Support multi-variable-declarations without value.
This commit is contained in:
parent
5dae888c00
commit
3a4769bd99
@ -213,11 +213,17 @@ void StackToMemoryMover::operator()(Block& _block)
|
||||
else
|
||||
return {};
|
||||
}
|
||||
FunctionCall const* functionCall = get_if<FunctionCall>(_stmt.value.get());
|
||||
yulAssert(functionCall, "");
|
||||
auto rhsMemorySlots = m_functionReturnVariables.at(functionCall->functionName.name) |
|
||||
ranges::views::transform(m_memoryOffsetTracker) |
|
||||
ranges::to<vector<optional<YulString>>>;
|
||||
vector<optional<YulString>> rhsMemorySlots;
|
||||
if (_stmt.value)
|
||||
{
|
||||
FunctionCall const* functionCall = get_if<FunctionCall>(_stmt.value.get());
|
||||
yulAssert(functionCall, "");
|
||||
rhsMemorySlots = m_functionReturnVariables.at(functionCall->functionName.name) |
|
||||
ranges::views::transform(m_memoryOffsetTracker) |
|
||||
ranges::to<vector<optional<YulString>>>;
|
||||
}
|
||||
else
|
||||
rhsMemorySlots = vector<optional<YulString>>(_lhsVars.size(), nullopt);
|
||||
|
||||
// Nothing to do, if the right-hand-side remains entirely on the stack and
|
||||
// none of the variables in the left-hand-side are moved.
|
||||
|
@ -0,0 +1,21 @@
|
||||
{
|
||||
mstore(0x40, memoryguard(0x60))
|
||||
{
|
||||
let x, y
|
||||
}
|
||||
{
|
||||
let z, $w
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// step: fakeStackLimitEvader
|
||||
//
|
||||
// {
|
||||
// mstore(0x40, memoryguard(0x80))
|
||||
// { let x, y }
|
||||
// {
|
||||
// let z_1, $w_2
|
||||
// mstore(0x60, $w_2)
|
||||
// let z := z_1
|
||||
// }
|
||||
// }
|
Loading…
Reference in New Issue
Block a user