No review, attempted build fix.
authormjs@apple.com <mjs@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 13 May 2010 12:05:20 +0000 (12:05 +0000)
committermjs@apple.com <mjs@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 13 May 2010 12:05:20 +0000 (12:05 +0000)
Try to fix Tiger build with some gratuitous initialization of
seemingly uninitialized variables.

* wtf/text/StringImpl.h:
(WebCore::StringImpl::tryCreateUninitialized):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@59358 268f45cc-cd09-0410-ab3c-d52691b4dbfc

JavaScriptCore/ChangeLog
JavaScriptCore/wtf/text/StringImpl.h

index 61b609f86d978e70ba5b19fbe9367c043986b0b0..7ac6b3cb96d0c4ac0fb61816a54298b1f9641159 100644 (file)
@@ -1,3 +1,13 @@
+2010-05-13  Maciej Stachowiak  <mjs@apple.com>
+
+        No review, attempted build fix.
+
+        Try to fix Tiger build with some gratuitous initialization of
+        seemingly uninitialized variables.
+
+        * wtf/text/StringImpl.h:
+        (WebCore::StringImpl::tryCreateUninitialized):
+
 2010-05-13  Maciej Stachowiak  <mjs@apple.com>
 
         Reviewed by Mark Rowe.
index 029a89531df853a7d0373c9029f5433c6ec06b70..f4b2970283f6633ff351726f9db8916f18e6fc3e 100644 (file)
@@ -171,11 +171,15 @@ public:
             return empty();
         }
 
-        if (length > ((std::numeric_limits<size_t>::max() - sizeof(StringImpl)) / sizeof(UChar)))
+        if (length > ((std::numeric_limits<size_t>::max() - sizeof(StringImpl)) / sizeof(UChar))) {
+            output = 0;
             return 0;
+        }
         StringImpl* resultImpl;
-        if (!tryFastMalloc(sizeof(UChar) * length + sizeof(StringImpl)).getValue(resultImpl))
+        if (!tryFastMalloc(sizeof(UChar) * length + sizeof(StringImpl)).getValue(resultImpl)) {
+            output = 0;
             return 0;
+        }
         output = reinterpret_cast<UChar*>(resultImpl + 1);
         return adoptRef(new(resultImpl) StringImpl(length));
     }