mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #3697 from ethereum/fixAvoidStorageClearLoop
Properly skip cleanup if only enlarging storage array.
This commit is contained in:
commit
c6e9dd13bc
@ -4,6 +4,7 @@ Features:
|
|||||||
|
|
||||||
|
|
||||||
Bugfixes:
|
Bugfixes:
|
||||||
|
* Code Generator: Properly skip unneeded storgae array cleanup when not reducing length.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -744,7 +744,7 @@ void ArrayUtils::resizeDynamicArray(ArrayType const& _typeIn) const
|
|||||||
_context << Instruction::DUP4 << Instruction::SSTORE;
|
_context << Instruction::DUP4 << Instruction::SSTORE;
|
||||||
// skip if size is not reduced
|
// skip if size is not reduced
|
||||||
_context << Instruction::DUP2 << Instruction::DUP2
|
_context << Instruction::DUP2 << Instruction::DUP2
|
||||||
<< Instruction::ISZERO << Instruction::GT;
|
<< Instruction::GT << Instruction::ISZERO;
|
||||||
_context.appendConditionalJumpTo(resizeEnd);
|
_context.appendConditionalJumpTo(resizeEnd);
|
||||||
|
|
||||||
// size reduced, clear the end of the array
|
// size reduced, clear the end of the array
|
||||||
|
Loading…
Reference in New Issue
Block a user