Skip to content

Commit 3e98130

Browse files
committed
fixup! fixup! fixup! Review comments
1 parent d0a0594 commit 3e98130

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

Changelog.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Compiler Features:
99
Bugfixes:
1010
* SMTChecker: Fix internal error on mapping access caused by too strong requirements on sort compatibility of the index and mapping domain.
1111
* SMTChecker: Fix internal error when using bitwise operators with an array element as argument.
12-
* Yul Optimizer: Fix ``SSATransform`` step that would sometimes cause non-deterministic output in cases where one or more unused contracts were added to the compilation pipeline.
12+
* Yul Optimizer: Fix the order of assignments generated by ``SSATransform`` being dependent on AST IDs, sometimes resulting in different (but equivalent) bytecode when unrelated files were added to the compilation pipeline.
1313

1414

1515
### 0.8.25 (2023-03-14)

libsolutil/CommonData.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,14 @@ inline std::multiset<T...>& operator-=(std::multiset<T...>& _a, C const& _b)
159159
return _a;
160160
}
161161

162+
/// Remove the elements of a container from a vector
163+
template <class T, class U> std::vector<T>& operator-=(std::vector<T>& _a, U& _b)
164+
{
165+
for (auto const& i: _b)
166+
_a.erase(std::find(_a.begin(), _a.end(), i));
167+
return _a;
168+
}
169+
162170
namespace solidity::util
163171
{
164172

@@ -468,14 +476,6 @@ void appendMissing(std::vector<T>& _destination, std::vector<T> const& _source)
468476
tryEmplaceBack(_destination, elem);
469477
}
470478

471-
/// Function that removes all elements present in vector @param _sub from vector @param _super.
472-
template <class T>
473-
void removeVectorSubset(std::vector<T>& _super, std::vector<T> const& _sub)
474-
{
475-
for (auto const& elem: _sub)
476-
_super.erase(std::find(_super.begin(), _super.end(), elem));
477-
}
478-
479479
/// Function that iterates over a vector, calling a function on each of its
480480
/// elements. If that function returns a vector, the element is replaced by
481481
/// the returned vector. During the iteration, the original vector is only valid

libyul/optimiser/SSATransform.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ void IntroduceControlFlowSSA::operator()(Block& _block)
272272

273273
util::appendMissing(m_variablesToReassign, assignedVariables);
274274
m_variablesInScope -= variablesDeclaredHere;
275-
util::removeVectorSubset(m_variablesToReassign, variablesDeclaredHere);
275+
m_variablesToReassign -= variablesDeclaredHere;
276276
}
277277

278278
/**

0 commit comments

Comments
 (0)