mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
fixup! Limit max chunk size in CommonSubexpressionEliminator::feedItems
This commit is contained in:
parent
63f53a19dd
commit
91638ed7b2
@ -180,13 +180,14 @@ AssemblyItemIterator CommonSubexpressionEliminator::feedItems(
|
|||||||
{
|
{
|
||||||
assertThrow(!m_breakingItem, OptimizerException, "Invalid use of CommonSubexpressionEliminator.");
|
assertThrow(!m_breakingItem, OptimizerException, "Invalid use of CommonSubexpressionEliminator.");
|
||||||
unsigned const maxChunkSize = 1000;
|
unsigned const maxChunkSize = 1000;
|
||||||
|
unsigned chunkSize = 0;
|
||||||
for (
|
for (
|
||||||
unsigned chunkSize = 0;
|
;
|
||||||
_iterator != _end && !SemanticInformation::breaksCSEAnalysisBlock(*_iterator, _msizeImportant) && chunkSize < maxChunkSize;
|
_iterator != _end && !SemanticInformation::breaksCSEAnalysisBlock(*_iterator, _msizeImportant) && chunkSize < maxChunkSize;
|
||||||
++_iterator, ++chunkSize
|
++_iterator, ++chunkSize
|
||||||
)
|
)
|
||||||
feedItem(*_iterator);
|
feedItem(*_iterator);
|
||||||
if (_iterator != _end)
|
if (_iterator != _end && chunkSize < maxChunkSize)
|
||||||
m_breakingItem = &(*_iterator++);
|
m_breakingItem = &(*_iterator++);
|
||||||
return _iterator;
|
return _iterator;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user