Title: [224087] trunk/Source/WebCore
Revision
224087
Author
[email protected]
Date
2017-10-27 00:04:51 -0700 (Fri, 27 Oct 2017)

Log Message

[GTK] Crash in WebCore::SelectionRangeData::apply
https://bugs.webkit.org/show_bug.cgi?id=177808

Reviewed by Carlos Garcia Campos.

The problem appears to be a name collision between WebCore::SelectionData and
WebCore::SelectionData. Yes, those are the same names. It seems the destructor for a
Source/WebCore/platform/gtk/SelectionData.h SelectionData is being called on a
Source/WebCore/rendering/SelectionRangeData.cpp SelectionData. Yikes. Can you forgive the
poor linker for not being magic?

This fixes crashes in approximately one bajillion tests.

* rendering/SelectionRangeData.cpp: Move SelectionData into an anonymous namespace.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (224086 => 224087)


--- trunk/Source/WebCore/ChangeLog	2017-10-27 06:18:45 UTC (rev 224086)
+++ trunk/Source/WebCore/ChangeLog	2017-10-27 07:04:51 UTC (rev 224087)
@@ -1,3 +1,20 @@
+2017-10-27  Michael Catanzaro  <[email protected]>
+
+        [GTK] Crash in WebCore::SelectionRangeData::apply
+        https://bugs.webkit.org/show_bug.cgi?id=177808
+
+        Reviewed by Carlos Garcia Campos.
+
+        The problem appears to be a name collision between WebCore::SelectionData and
+        WebCore::SelectionData. Yes, those are the same names. It seems the destructor for a
+        Source/WebCore/platform/gtk/SelectionData.h SelectionData is being called on a
+        Source/WebCore/rendering/SelectionRangeData.cpp SelectionData. Yikes. Can you forgive the
+        poor linker for not being magic?
+
+        This fixes crashes in approximately one bajillion tests.
+
+        * rendering/SelectionRangeData.cpp: Move SelectionData into an anonymous namespace.
+
 2017-10-26  Basuke Suzuki  <[email protected]>
 
         [WinCairo] Fix build after WebCore moves to unified source.

Modified: trunk/Source/WebCore/rendering/SelectionRangeData.cpp (224086 => 224087)


--- trunk/Source/WebCore/rendering/SelectionRangeData.cpp	2017-10-27 06:18:45 UTC (rev 224086)
+++ trunk/Source/WebCore/rendering/SelectionRangeData.cpp	2017-10-27 07:04:51 UTC (rev 224087)
@@ -42,7 +42,9 @@
 #include "VisibleSelection.h"
 
 namespace WebCore {
-    
+
+namespace { // See bug #177808.
+
 struct SelectionData {
     using RendererMap = HashMap<RenderObject*, std::unique_ptr<RenderSelectionInfo>>;
     using RenderBlockMap = HashMap<const RenderBlock*, std::unique_ptr<RenderBlockSelectionInfo>>;
@@ -94,6 +96,8 @@
     Vector<RenderMultiColumnSpannerPlaceholder*> m_spannerStack;
 };
 
+} // anonymous namespace
+
 static RenderObject* rendererAfterPosition(const RenderObject& renderer, unsigned offset)
 {
     auto* child = renderer.childAt(offset);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to