Skip to content

Commit 04ac1f7

Browse files
zyn0217aokblast
authored andcommitted
[Clang] Fix a use-after-move issue in SubsumptionChecker (llvm#164781)
Spotted by Shafik.
1 parent 500c436 commit 04ac1f7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

clang/lib/Sema/SemaConcept.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2700,8 +2700,9 @@ FormulaType SubsumptionChecker::Normalize(const NormalizedConstraint &NC) {
27002700
});
27012701

27022702
if (Compound.getCompoundKind() == FormulaType::Kind) {
2703+
unsigned SizeLeft = Left.size();
27032704
Res = std::move(Left);
2704-
Res.reserve(Left.size() + Right.size());
2705+
Res.reserve(SizeLeft + Right.size());
27052706
std::for_each(std::make_move_iterator(Right.begin()),
27062707
std::make_move_iterator(Right.end()), Add);
27072708
return Res;

0 commit comments

Comments
 (0)