Skip to content

Commit a630f59

Browse files
committed
Fix infinite loop in Projection.
This was necessary for compilation purposes but was never executed. It was caught by a clang warning.
1 parent bc17264 commit a630f59

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

include/swift/SIL/Projection.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ class ProjectionPath {
394394
/// We only allow for moves of ProjectionPath since we only want them to be
395395
/// able to be constructed by calling our factory method or by going through
396396
/// the append function.
397-
ProjectionPath(ProjectionPath &&Other) : Path(Other.Path) {}
397+
ProjectionPath(ProjectionPath &&Other) : Path(std::move(Other.Path)) {}
398398

399399
/// Append the projection P onto this.
400400
ProjectionPath &append(const Projection &P) {
@@ -411,8 +411,7 @@ class ProjectionPath {
411411
}
412412

413413
ProjectionPath &operator=(ProjectionPath &&O) {
414-
*this = std::move(O);
415-
O.Path.clear();
414+
std::swap(Path, O.Path);
416415
return *this;
417416
}
418417

0 commit comments

Comments
 (0)