Bug 116337 - Add a compile assert for the size of RootInlineBox and InlineTextbox
Summary: Add a compile assert for the size of RootInlineBox and InlineTextbox
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-05-17 11:33 PDT by Lamarque V. Souza
Modified: 2013-05-20 06:36 PDT (History)
4 users (show)

See Also:


Attachments
Patch (2.29 KB, patch)
2013-05-17 11:39 PDT, Lamarque V. Souza
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Lamarque V. Souza 2013-05-17 11:33:44 PDT
Add ompile asserts for the size of RootInlineBox and InlineTextbox as suggested in https://bugs.webkit.org/show_bug.cgi?id=116108#c10
Comment 1 Lamarque V. Souza 2013-05-17 11:39:14 PDT
Created attachment 202128 [details]
Patch

Proposed patch.
Comment 2 Darin Adler 2013-05-17 12:45:53 PDT
Comment on attachment 202128 [details]
Patch

OK.
Comment 3 Bruno Abinader (history only) 2013-05-20 06:29:01 PDT
Comment on attachment 202128 [details]
Patch

>Subversion Revision: 150274
>diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
>index c3462a41eeba42daea64b3dd52e1cd5a2921f833..87f3a4d71cf3831575bdb44b62523b863aa2747c 100644
>--- a/Source/WebCore/ChangeLog
>+++ b/Source/WebCore/ChangeLog
>@@ -1,3 +1,19 @@
>+2013-05-17  Lamarque V. Souza  <Lamarque.Souza@basyskom.com>
>+
>+        Add compile asserts for the size of RootInlineBox and InlineTextbox
>+        https://bugs.webkit.org/show_bug.cgi?id=116337
>+
>+        Reviewed by NOBODY (OOPS!).
>+
>+        Add compile asserts to ensure RootInlineBox and InlineTextbox stay small.
>+
>+        * rendering/InlineTextBox.cpp:
>+        (SameSizeAsInlineTextBox):
>+        (WebCore):
>+        * rendering/RootInlineBox.cpp:
>+        (SameSizeAsRootInlineBox):
>+        (WebCore):
>+
> 2013-05-17  Darin Adler  <darin@apple.com>
> 
>         [EFL] Move EFL port off legacy clipboard
>diff --git a/Source/WebCore/rendering/InlineTextBox.cpp b/Source/WebCore/rendering/InlineTextBox.cpp
>index 26e84ff73d1ac40a3bca1c9b359a617e1fe957db..365d02eb6e68766a59ed3cc3ae0270531188223e 100644
>--- a/Source/WebCore/rendering/InlineTextBox.cpp
>+++ b/Source/WebCore/rendering/InlineTextBox.cpp
>@@ -53,6 +53,14 @@ using namespace std;
> 
> namespace WebCore {
> 
>+struct SameSizeAsInlineTextBox : public InlineBox {
>+    unsigned variables[1];
>+    unsigned short variables2[2];
>+    void* pointers[2];
>+};
>+
>+COMPILE_ASSERT(sizeof(InlineTextBox) == sizeof(SameSizeAsInlineTextBox), InlineTextBox_should_stay_small);
>+
> typedef WTF::HashMap<const InlineTextBox*, LayoutRect> InlineTextBoxOverflowMap;
> static InlineTextBoxOverflowMap* gTextBoxesWithOverflow;
> 
>diff --git a/Source/WebCore/rendering/RootInlineBox.cpp b/Source/WebCore/rendering/RootInlineBox.cpp
>index 626c8864a2769cda388ce82a42fb44e04c3e5d62..a83855d23b385222284140c0b83e24f5f32048c9 100644
>--- a/Source/WebCore/rendering/RootInlineBox.cpp
>+++ b/Source/WebCore/rendering/RootInlineBox.cpp
>@@ -43,6 +43,13 @@ using namespace std;
> 
> namespace WebCore {
>     
>+struct SameSizeAsRootInlineBox : public InlineFlowBox {
>+    unsigned variables[5];
>+    void* pointers[4];
>+};
>+
>+COMPILE_ASSERT(sizeof(RootInlineBox) == sizeof(SameSizeAsRootInlineBox), RootInlineBox_should_stay_small);
>+
> typedef WTF::HashMap<const RootInlineBox*, EllipsisBox*> EllipsisBoxMap;
> static EllipsisBoxMap* gEllipsisBoxMap = 0;
>
Comment 4 WebKit Commit Bot 2013-05-20 06:36:13 PDT
Comment on attachment 202128 [details]
Patch

Clearing flags on attachment: 202128

Committed r150365: <http://trac.webkit.org/changeset/150365>
Comment 5 WebKit Commit Bot 2013-05-20 06:36:15 PDT
All reviewed patches have been landed.  Closing bug.