Title: [157943] trunk/Source/WTF
Revision
157943
Author
[email protected]
Date
2013-10-24 12:12:11 -0700 (Thu, 24 Oct 2013)

Log Message

Unreviewed, rolling out r157931.
http://trac.webkit.org/changeset/157931
https://bugs.webkit.org/show_bug.cgi?id=123284

Seems to have caused a lot of assertions on debug bots
(Requested by ap on #webkit).

* wtf/text/StringStatics.cpp:
(WTF::StringImpl::empty):

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (157942 => 157943)


--- trunk/Source/WTF/ChangeLog	2013-10-24 19:10:48 UTC (rev 157942)
+++ trunk/Source/WTF/ChangeLog	2013-10-24 19:12:11 UTC (rev 157943)
@@ -1,3 +1,15 @@
+2013-10-24  Commit Queue  <[email protected]>
+
+        Unreviewed, rolling out r157931.
+        http://trac.webkit.org/changeset/157931
+        https://bugs.webkit.org/show_bug.cgi?id=123284
+
+        Seems to have caused a lot of assertions on debug bots
+        (Requested by ap on #webkit).
+
+        * wtf/text/StringStatics.cpp:
+        (WTF::StringImpl::empty):
+
 2013-10-24  Peter Molnar  <[email protected]>
 
         Remove PCRE workaround.

Modified: trunk/Source/WTF/wtf/text/StringStatics.cpp (157942 => 157943)


--- trunk/Source/WTF/wtf/text/StringStatics.cpp	2013-10-24 19:10:48 UTC (rev 157942)
+++ trunk/Source/WTF/wtf/text/StringStatics.cpp	2013-10-24 19:12:11 UTC (rev 157943)
@@ -43,7 +43,15 @@
 
 StringImpl* StringImpl::empty()
 {
-    DEFINE_STATIC_LOCAL(StringImpl, emptyString, (reinterpret_cast<UChar*>(static_cast<intptr_t>(1)), 0, ConstructStaticString));
+    // FIXME: This works around a bug in our port of PCRE, that a regular _expression_
+    // run on the empty string may still perform a read from the first element, and
+    // as such we need this to be a valid pointer. No code should ever be reading
+    // from a zero length string, so this should be able to be a non-null pointer
+    // into the zero-page.
+    // Replace this with 'reinterpret_cast<UChar*>(static_cast<intptr_t>(1))' once
+    // PCRE goes away.
+    static LChar emptyLCharData = 0;
+    DEFINE_STATIC_LOCAL(StringImpl, emptyString, (&emptyLCharData, 0, ConstructStaticString));
     WTF_ANNOTATE_BENIGN_RACE(&emptyString, "Benign race on StringImpl::emptyString reference counter");
     return &emptyString;
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to