Title: [259620] trunk/Source/WebCore
Revision
259620
Author
[email protected]
Date
2020-04-06 19:16:48 -0700 (Mon, 06 Apr 2020)

Log Message

Use-after-move of Vector<ManipulationToken> in TextManipulationController::observeParagraphs()
<https://webkit.org/b/210086>

Reviewed by Ryosuke Niwa.

* editing/TextManipulationController.cpp:
(WebCore::TextManipulationController::observeParagraphs):
- Replace WTFMove() with std::exchange() to fix the clang static
  analyzer warning.  For WTF::Vector, this has no change in
  behavior.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (259619 => 259620)


--- trunk/Source/WebCore/ChangeLog	2020-04-07 01:45:56 UTC (rev 259619)
+++ trunk/Source/WebCore/ChangeLog	2020-04-07 02:16:48 UTC (rev 259620)
@@ -1,3 +1,16 @@
+2020-04-06  David Kilzer  <[email protected]>
+
+        Use-after-move of Vector<ManipulationToken> in TextManipulationController::observeParagraphs()
+        <https://webkit.org/b/210086>
+
+        Reviewed by Ryosuke Niwa.
+
+        * editing/TextManipulationController.cpp:
+        (WebCore::TextManipulationController::observeParagraphs):
+        - Replace WTFMove() with std::exchange() to fix the clang static
+          analyzer warning.  For WTF::Vector, this has no change in
+          behavior.
+
 2020-04-06  Jack Lee  <[email protected]>
 
         Nullptr crash in WebCore::lastPositionInNode when indenting text node that has user-select:all parent.

Modified: trunk/Source/WebCore/editing/TextManipulationController.cpp (259619 => 259620)


--- trunk/Source/WebCore/editing/TextManipulationController.cpp	2020-04-07 01:45:56 UTC (rev 259619)
+++ trunk/Source/WebCore/editing/TextManipulationController.cpp	2020-04-07 02:16:48 UTC (rev 259620)
@@ -304,7 +304,7 @@
                     endOfCurrentParagraph = Position(&textNode, offsetOfNextNewLine);
                     startOfCurrentParagraph = Position(&textNode, offsetOfNextNewLine + 1);
                 }
-                addItem(ManipulationItemData { startOfCurrentParagraph, endOfCurrentParagraph, nullptr, nullQName(), WTFMove(tokensInCurrentParagraph) });
+                addItem(ManipulationItemData { startOfCurrentParagraph, endOfCurrentParagraph, nullptr, nullQName(), std::exchange(tokensInCurrentParagraph, { }) });
                 startOfCurrentParagraph.clear();
             }
             startOfCurrentLine = offsetOfNextNewLine + 1;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to