Fix crash when compiled with Clang with LTO enabled
authorAdrian Perez de Castro <aperez@igalia.com>
Mon, 26 Aug 2024 15:14:46 +0000 (17:14 +0200)
committerAlberto Garcia <berto@igalia.com>
Mon, 26 Aug 2024 15:14:46 +0000 (17:14 +0200)
Bug: https://bugs.webkit.org/show_bug.cgi?id=274780
Origin: https://github.com/WebKit/WebKit/commit/4854b944b345990e4100319662777856fe8ea4aa

===================================================================

Gbp-Pq: Name fix-clang-build.patch

Source/WebCore/rendering/TextDecorationPainter.cpp

index 229857f64ad4c1a5c78ae4fa41b324cd7cbb0fa2..a58bbd86f452d16c66ef41d673949cba6794a7a6 100644 (file)
@@ -140,8 +140,10 @@ static DashArray translateIntersectionPointsToSkipInkBoundaries(const DashArray&
             else
                 intermediateTuples.append(*i);
         }
-    } else
-        intermediateTuples = tuples;
+    } else {
+        // XXX(274780): A plain assignment or move here makes Clang generate bad code in LTO builds.
+        intermediateTuples.swap(tuples);
+    }
 
     // Step 3: Output the space between the ranges, but only if the space warrants an underline.
     float previous = 0;