Title: [160462] trunk/Source
Revision
160462
Author
[email protected]
Date
2013-12-11 15:15:45 -0800 (Wed, 11 Dec 2013)

Log Message

Define m_hasBadParent in InlineBox if defined(ADDRESS_SANITIZER)
<http://webkit.org/b/125329>

Reviewed by Darin Adler.

Source/WebCore:

No tests since this is a build fix for:

    $ ./Tools/Scripts/build-webkit --release OTHER_CFLAGS="$inherited -DADDRESS_SANITIZER=1"

* rendering/InlineBox.cpp:
* rendering/InlineBox.h:
- Replace ASSERT_DISABLED use with
  ASSERT_WITH_SECURITY_IMPLICATION_DISABLED for m_hasBadParent.

* rendering/InlineFlowBox.cpp:
(WebCore::InlineFlowBox::~InlineFlowBox):
- Use !ASSERT_WITH_SECURITY_IMPLICATION_DISABLED instead of
  #ifndef NDEBUG since this calls setHasBadParent().
(WebCore::InlineFlowBox::checkConsistency):
- Move ASSERT(!m_hasBadChildList) outside of
  #if CHECK_CONSISTENCY and change to
  ASSERT_WITH_SECURITY_IMPLICATION(!m_hasBadChildList).

* rendering/InlineFlowBox.h:
(WebCore::InlineFlowBox::InlineFlowBox):
(WebCore::InlineFlowBox::setHasBadChildList):
- Change #ifndef NDEBUG to
  #if !ASSERT_WITH_SECURITY_IMPLICATION_DISABLED for code using
  m_hasBadChildList.

Source/WTF:

* wtf/Assertions.h: Define macro
ASSERT_WITH_SECURITY_IMPLICATION_DISABLED based on whether
ASSERT_WITH_SECURITY_IMPLICATION() is enabled.

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (160461 => 160462)


--- trunk/Source/WTF/ChangeLog	2013-12-11 23:05:52 UTC (rev 160461)
+++ trunk/Source/WTF/ChangeLog	2013-12-11 23:15:45 UTC (rev 160462)
@@ -1,3 +1,14 @@
+2013-12-11  David Kilzer  <[email protected]>
+
+        Define m_hasBadParent in InlineBox if defined(ADDRESS_SANITIZER)
+        <http://webkit.org/b/125329>
+
+        Reviewed by Darin Adler.
+
+        * wtf/Assertions.h: Define macro
+        ASSERT_WITH_SECURITY_IMPLICATION_DISABLED based on whether
+        ASSERT_WITH_SECURITY_IMPLICATION() is enabled.
+
 2013-12-11  Brendan Long  <[email protected]>
 
         Type punning error in MD5.cpp

Modified: trunk/Source/WTF/wtf/Assertions.h (160461 => 160462)


--- trunk/Source/WTF/wtf/Assertions.h	2013-12-11 23:05:52 UTC (rev 160461)
+++ trunk/Source/WTF/wtf/Assertions.h	2013-12-11 23:15:45 UTC (rev 160462)
@@ -238,8 +238,10 @@
          CRASH_WITH_SECURITY_IMPLICATION()) : \
         (void)0)
 
+#define ASSERT_WITH_SECURITY_IMPLICATION_DISABLED 0
 #else
 #define ASSERT_WITH_SECURITY_IMPLICATION(assertion) ((void)0)
+#define ASSERT_WITH_SECURITY_IMPLICATION_DISABLED 1
 #endif
 
 #else
@@ -278,6 +280,7 @@
         (WTFReportAssertionFailure(__FILE__, __LINE__, WTF_PRETTY_FUNCTION, #assertion), \
          CRASH_WITH_SECURITY_IMPLICATION()) : \
         (void)0)
+#define ASSERT_WITH_SECURITY_IMPLICATION_DISABLED 0
 #endif
 
 /* ASSERT_WITH_MESSAGE */

Modified: trunk/Source/WebCore/ChangeLog (160461 => 160462)


--- trunk/Source/WebCore/ChangeLog	2013-12-11 23:05:52 UTC (rev 160461)
+++ trunk/Source/WebCore/ChangeLog	2013-12-11 23:15:45 UTC (rev 160462)
@@ -1,3 +1,35 @@
+2013-12-11  David Kilzer  <[email protected]>
+
+        Define m_hasBadParent in InlineBox if defined(ADDRESS_SANITIZER)
+        <http://webkit.org/b/125329>
+
+        Reviewed by Darin Adler.
+
+        No tests since this is a build fix for:
+
+            $ ./Tools/Scripts/build-webkit --release OTHER_CFLAGS="$inherited -DADDRESS_SANITIZER=1"
+
+        * rendering/InlineBox.cpp:
+        * rendering/InlineBox.h:
+        - Replace ASSERT_DISABLED use with
+          ASSERT_WITH_SECURITY_IMPLICATION_DISABLED for m_hasBadParent.
+
+        * rendering/InlineFlowBox.cpp:
+        (WebCore::InlineFlowBox::~InlineFlowBox):
+        - Use !ASSERT_WITH_SECURITY_IMPLICATION_DISABLED instead of
+          #ifndef NDEBUG since this calls setHasBadParent().
+        (WebCore::InlineFlowBox::checkConsistency):
+        - Move ASSERT(!m_hasBadChildList) outside of
+          #if CHECK_CONSISTENCY and change to
+          ASSERT_WITH_SECURITY_IMPLICATION(!m_hasBadChildList).
+
+        * rendering/InlineFlowBox.h:
+        (WebCore::InlineFlowBox::InlineFlowBox):
+        (WebCore::InlineFlowBox::setHasBadChildList):
+        - Change #ifndef NDEBUG to
+          #if !ASSERT_WITH_SECURITY_IMPLICATION_DISABLED for code using
+          m_hasBadChildList.
+
 2013-12-11  Ralph Thomas  <[email protected]>
 
         [WebGL] Fix build on GL ES 2.0 targets after r160119

Modified: trunk/Source/WebCore/rendering/InlineBox.cpp (160461 => 160462)


--- trunk/Source/WebCore/rendering/InlineBox.cpp	2013-12-11 23:05:52 UTC (rev 160461)
+++ trunk/Source/WebCore/rendering/InlineBox.cpp	2013-12-11 23:15:45 UTC (rev 160462)
@@ -42,14 +42,14 @@
     FloatPoint b;
     float c;
     uint32_t d : 32;
-#if !ASSERT_DISABLED
+#if !ASSERT_WITH_SECURITY_IMPLICATION_DISABLED
     bool f;
 #endif
 };
 
 COMPILE_ASSERT(sizeof(InlineBox) == sizeof(SameSizeAsInlineBox), InlineBox_size_guard);
 
-#if !ASSERT_DISABLED
+#if !ASSERT_WITH_SECURITY_IMPLICATION_DISABLED
 InlineBox::~InlineBox()
 {
     if (!m_hasBadParent && m_parent)

Modified: trunk/Source/WebCore/rendering/InlineBox.h (160461 => 160462)


--- trunk/Source/WebCore/rendering/InlineBox.h	2013-12-11 23:05:52 UTC (rev 160461)
+++ trunk/Source/WebCore/rendering/InlineBox.h	2013-12-11 23:15:45 UTC (rev 160462)
@@ -236,7 +236,7 @@
     // visibleLeftEdge, visibleRightEdge are in the parent's coordinate system.
     virtual float placeEllipsisBox(bool ltr, float visibleLeftEdge, float visibleRightEdge, float ellipsisWidth, float &truncatedWidth, bool&);
 
-#if !ASSERT_DISABLED
+#if !ASSERT_WITH_SECURITY_IMPLICATION_DISABLED
     void setHasBadParent();
 #endif
 
@@ -368,7 +368,7 @@
         , m_parent(nullptr)
         , m_renderer(renderer)
         , m_logicalWidth(0)
-#if !ASSERT_DISABLED
+#if !ASSERT_WITH_SECURITY_IMPLICATION_DISABLED
         , m_hasBadParent(false)
 #endif
     {
@@ -383,7 +383,7 @@
         , m_topLeft(topLeft)
         , m_logicalWidth(logicalWidth)
         , m_bitfields(firstLine, constructed, dirty, extracted, isHorizontal)
-#if !ASSERT_DISABLED
+#if !ASSERT_WITH_SECURITY_IMPLICATION_DISABLED
         , m_hasBadParent(false)
 #endif
     {
@@ -408,7 +408,7 @@
     // For InlineFlowBox and InlineTextBox
     bool extracted() const { return m_bitfields.extracted(); }
 
-#if !ASSERT_DISABLED
+#if !ASSERT_WITH_SECURITY_IMPLICATION_DISABLED
 private:
     bool m_hasBadParent;
 #endif
@@ -417,13 +417,13 @@
 #define INLINE_BOX_OBJECT_TYPE_CASTS(ToValueTypeName, predicate) \
     TYPE_CASTS_BASE(ToValueTypeName, InlineBox, object, object->predicate, object.predicate)
 
-#if ASSERT_DISABLED
+#if ASSERT_WITH_SECURITY_IMPLICATION_DISABLED
 inline InlineBox::~InlineBox()
 {
 }
 #endif
 
-#if !ASSERT_DISABLED
+#if !ASSERT_WITH_SECURITY_IMPLICATION_DISABLED
 inline void InlineBox::setHasBadParent()
 {
     m_hasBadParent = true;

Modified: trunk/Source/WebCore/rendering/InlineFlowBox.cpp (160461 => 160462)


--- trunk/Source/WebCore/rendering/InlineFlowBox.cpp	2013-12-11 23:05:52 UTC (rev 160461)
+++ trunk/Source/WebCore/rendering/InlineFlowBox.cpp	2013-12-11 23:15:45 UTC (rev 160462)
@@ -49,15 +49,14 @@
 
 COMPILE_ASSERT(sizeof(InlineFlowBox) == sizeof(SameSizeAsInlineFlowBox), InlineFlowBox_should_stay_small);
 
-#ifndef NDEBUG
-
+#if !ASSERT_WITH_SECURITY_IMPLICATION_DISABLED
 InlineFlowBox::~InlineFlowBox()
 {
-    if (!m_hasBadChildList)
+    if (!m_hasBadChildList) {
         for (InlineBox* child = firstChild(); child; child = child->nextOnLine())
             child->setHasBadParent();
+    }
 }
-
 #endif
 
 LayoutUnit InlineFlowBox::getFlowSpacingLogicalWidth()
@@ -1666,8 +1665,8 @@
 
 void InlineFlowBox::checkConsistency() const
 {
+    ASSERT_WITH_SECURITY_IMPLICATION(!m_hasBadChildList);
 #ifdef CHECK_CONSISTENCY
-    ASSERT(!m_hasBadChildList);
     const InlineBox* prev = 0;
     for (const InlineBox* child = m_firstChild; child; child = child->nextOnLine()) {
         ASSERT(child->parent() == this);

Modified: trunk/Source/WebCore/rendering/InlineFlowBox.h (160461 => 160462)


--- trunk/Source/WebCore/rendering/InlineFlowBox.h	2013-12-11 23:05:52 UTC (rev 160461)
+++ trunk/Source/WebCore/rendering/InlineFlowBox.h	2013-12-11 23:15:45 UTC (rev 160462)
@@ -53,7 +53,7 @@
         , m_hasAnnotationsBefore(false)
         , m_hasAnnotationsAfter(false)
         , m_isFirstAfterPageBreak(false)
-#ifndef NDEBUG
+#if !ASSERT_WITH_SECURITY_IMPLICATION_DISABLED
         , m_hasBadChildList(false)
 #endif
     {
@@ -66,9 +66,11 @@
         m_hasTextDescendants = m_hasTextChildren;
     }
 
+#if !ASSERT_WITH_SECURITY_IMPLICATION_DISABLED
+    virtual ~InlineFlowBox();
+#endif
+
 #ifndef NDEBUG
-    virtual ~InlineFlowBox();
-    
     virtual void showLineTreeAndMark(const InlineBox* = 0, const char* = 0, const InlineBox* = 0, const char* = 0, const RenderObject* = 0, int = 0) const OVERRIDE;
     virtual const char* boxName() const OVERRIDE;
 #endif
@@ -340,7 +342,7 @@
 
     // End of RootInlineBox-specific members.
 
-#ifndef NDEBUG
+#if !ASSERT_WITH_SECURITY_IMPLICATION_DISABLED
 private:
     unsigned m_hasBadChildList : 1;
 #endif
@@ -356,7 +358,7 @@
 
 inline void InlineFlowBox::setHasBadChildList()
 {
-#ifndef NDEBUG
+#if !ASSERT_WITH_SECURITY_IMPLICATION_DISABLED
     m_hasBadChildList = true;
 #endif
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to