Skip to content

Commit

Permalink
REGRESSION(288829@main) [CMake] Build failure with clang-18 crashing …
Browse files Browse the repository at this point in the history
…on Vector::map and complex LengthPercentage templates https://bugs.webkit.org/show_bug.cgi?id=286004

Reviewed by NOBODY (OOPS!).

Related to llvm's llvm/llvm-project#93206, a fix
that's part of clang-19. As clang-18 is still quite new and the version
in distros like Ubuntu 24.04 LTS, we are adding a workaround on this
commit.

Thanks to Fujii Hironori for the suggested simpler fix of removing the
lambda return type instead of replacing the map with a for loop.

* Source/WebCore/rendering/shapes/LayoutShape.cpp:
(WebCore::LayoutShape::createShape):
* Source/WebCore/style/values/shapes/StylePolygonFunction.cpp:
(WebCore::Style::PathComputation<Polygon>::operator):
  • Loading branch information
lauromoura authored and dpino committed Jan 23, 2025
1 parent 6078645 commit 5efb855
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Source/WebCore/rendering/shapes/LayoutShape.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ Ref<const LayoutShape> LayoutShape::createShape(const Style::BasicShape& basicSh
[&](const Style::PolygonFunction& polygon) -> Ref<LayoutShape> {
auto boxSize = FloatSize { boxWidth, boxHeight };

auto vertices = polygon->vertices.value.map([&](const auto& vertex) -> FloatPoint {
auto vertices = polygon->vertices.value.map([&](const auto& vertex) {
return physicalPointToLogical(Style::evaluate(vertex, boxSize) + borderBoxOffset, logicalBoxSize.height(), writingMode);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ WebCore::Path PathComputation<Polygon>::operator()(const Polygon& value, const F
{
auto boundingLocation = boundingBox.location();
auto boundingSize = boundingBox.size();
auto points = value.vertices.value.map([&](const auto& vertex) -> FloatPoint {
auto points = value.vertices.value.map([&](const auto& vertex) {
return evaluate(vertex, boundingSize) + boundingLocation;
});
return cachedPolygonPath(points);
Expand Down

0 comments on commit 5efb855

Please sign in to comment.