[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

darin darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 06:34:34 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit ca9d1cdd03aec82693e16ab08fc1221a2776892c
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sun Aug 25 06:41:13 2002 +0000

    	- fixed 3032072 -- Crash on reload in DOM::DocumentImpl::~DocumentImpl [unified]()
    
    	This was a tough one to debug.
    	Turned out to be a subtle bug in our new QConstString implementation.
    
            * kwq/KWQString.mm:
            (QStringData::makeAscii): Don't invalidate the Unicode buffer unless the ASCII
    	buffer is taking over the internal buffer from the Unicode. In other cases, it's
    	important not to invalidate the Unicode because it can result in the Unicode being
    	freed and re-created when unicode() is called, which is disastrous in the QConstString
    	case because we can't free the Unicode.
            (QStringData::makeUnicode): Make the corresponding change for ASCII too. In this
    	case, it's just an optimization, not a bug fix.
            (QString::insert), (QString::remove), (QString::fill), (QString::operator+=):
    	Mark the other string invalid whenever we modify either the ASCII or the Unicode
    	string. This was handled correctly for some operations before, but not all, and it
    	now matters because makeAscii and makeUnicode will now allow this state.
    
    	Fixed a separate QString problem; I think I may have introduced this one.
    
            * kwq/KWQString.mm:
            (QString::getNSString): Since by ASCII, we actually mean ISO Latin 1, we can't use
    	[NSString stringWithCString:]. Use CFStringCreateWithCString instead, pass
    	CFStringCreateWithCString as the encoding, and use autorelease. We shouldn't really
    	use the term ASCII in this class for the 8-bit-per-character buffer. Something more
    	like Latin1 would be a more accurate way to refer to it. Maybe I'll do that renaming
    	after talking to Richard about it on Monday.
    
    	Fixed a small storage leak.
    
            * khtml/css/css_valueimpl.cpp: (CSSPrimitiveValueImpl::cleanup): Added braces to
    	fix obviously-incorrect if/else grouping.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@1912 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2002-12-03 b/WebCore/ChangeLog-2002-12-03
index 3919ee0..892c7ff 100644
--- a/WebCore/ChangeLog-2002-12-03
+++ b/WebCore/ChangeLog-2002-12-03
@@ -1,3 +1,38 @@
+2002-08-24  Darin Adler  <darin at apple.com>
+
+	- fixed 3032072 -- Crash on reload in DOM::DocumentImpl::~DocumentImpl [unified]()
+
+	This was a tough one to debug.
+	Turned out to be a subtle bug in our new QConstString implementation.
+
+        * kwq/KWQString.mm:
+        (QStringData::makeAscii): Don't invalidate the Unicode buffer unless the ASCII
+	buffer is taking over the internal buffer from the Unicode. In other cases, it's
+	important not to invalidate the Unicode because it can result in the Unicode being
+	freed and re-created when unicode() is called, which is disastrous in the QConstString
+	case because we can't free the Unicode.
+        (QStringData::makeUnicode): Make the corresponding change for ASCII too. In this
+	case, it's just an optimization, not a bug fix.
+        (QString::insert), (QString::remove), (QString::fill), (QString::operator+=):
+	Mark the other string invalid whenever we modify either the ASCII or the Unicode
+	string. This was handled correctly for some operations before, but not all, and it
+	now matters because makeAscii and makeUnicode will now allow this state.
+
+	Fixed a separate QString problem; I think I may have introduced this one.
+
+        * kwq/KWQString.mm:
+        (QString::getNSString): Since by ASCII, we actually mean ISO Latin 1, we can't use
+	[NSString stringWithCString:]. Use CFStringCreateWithCString instead, pass
+	CFStringCreateWithCString as the encoding, and use autorelease. We shouldn't really
+	use the term ASCII in this class for the 8-bit-per-character buffer. Something more
+	like Latin1 would be a more accurate way to refer to it. Maybe I'll do that renaming
+	after talking to Richard about it on Monday.
+
+	Fixed a small storage leak.
+
+        * khtml/css/css_valueimpl.cpp: (CSSPrimitiveValueImpl::cleanup): Added braces to
+	fix obviously-incorrect if/else grouping.
+
 2002-08-23  Darin Adler  <darin at apple.com>
 
 	Got the kurl-test in the Tests directory working again.
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 3919ee0..892c7ff 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,38 @@
+2002-08-24  Darin Adler  <darin at apple.com>
+
+	- fixed 3032072 -- Crash on reload in DOM::DocumentImpl::~DocumentImpl [unified]()
+
+	This was a tough one to debug.
+	Turned out to be a subtle bug in our new QConstString implementation.
+
+        * kwq/KWQString.mm:
+        (QStringData::makeAscii): Don't invalidate the Unicode buffer unless the ASCII
+	buffer is taking over the internal buffer from the Unicode. In other cases, it's
+	important not to invalidate the Unicode because it can result in the Unicode being
+	freed and re-created when unicode() is called, which is disastrous in the QConstString
+	case because we can't free the Unicode.
+        (QStringData::makeUnicode): Make the corresponding change for ASCII too. In this
+	case, it's just an optimization, not a bug fix.
+        (QString::insert), (QString::remove), (QString::fill), (QString::operator+=):
+	Mark the other string invalid whenever we modify either the ASCII or the Unicode
+	string. This was handled correctly for some operations before, but not all, and it
+	now matters because makeAscii and makeUnicode will now allow this state.
+
+	Fixed a separate QString problem; I think I may have introduced this one.
+
+        * kwq/KWQString.mm:
+        (QString::getNSString): Since by ASCII, we actually mean ISO Latin 1, we can't use
+	[NSString stringWithCString:]. Use CFStringCreateWithCString instead, pass
+	CFStringCreateWithCString as the encoding, and use autorelease. We shouldn't really
+	use the term ASCII in this class for the 8-bit-per-character buffer. Something more
+	like Latin1 would be a more accurate way to refer to it. Maybe I'll do that renaming
+	after talking to Richard about it on Monday.
+
+	Fixed a small storage leak.
+
+        * khtml/css/css_valueimpl.cpp: (CSSPrimitiveValueImpl::cleanup): Added braces to
+	fix obviously-incorrect if/else grouping.
+
 2002-08-23  Darin Adler  <darin at apple.com>
 
 	Got the kurl-test in the Tests directory working again.
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 3919ee0..892c7ff 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,38 @@
+2002-08-24  Darin Adler  <darin at apple.com>
+
+	- fixed 3032072 -- Crash on reload in DOM::DocumentImpl::~DocumentImpl [unified]()
+
+	This was a tough one to debug.
+	Turned out to be a subtle bug in our new QConstString implementation.
+
+        * kwq/KWQString.mm:
+        (QStringData::makeAscii): Don't invalidate the Unicode buffer unless the ASCII
+	buffer is taking over the internal buffer from the Unicode. In other cases, it's
+	important not to invalidate the Unicode because it can result in the Unicode being
+	freed and re-created when unicode() is called, which is disastrous in the QConstString
+	case because we can't free the Unicode.
+        (QStringData::makeUnicode): Make the corresponding change for ASCII too. In this
+	case, it's just an optimization, not a bug fix.
+        (QString::insert), (QString::remove), (QString::fill), (QString::operator+=):
+	Mark the other string invalid whenever we modify either the ASCII or the Unicode
+	string. This was handled correctly for some operations before, but not all, and it
+	now matters because makeAscii and makeUnicode will now allow this state.
+
+	Fixed a separate QString problem; I think I may have introduced this one.
+
+        * kwq/KWQString.mm:
+        (QString::getNSString): Since by ASCII, we actually mean ISO Latin 1, we can't use
+	[NSString stringWithCString:]. Use CFStringCreateWithCString instead, pass
+	CFStringCreateWithCString as the encoding, and use autorelease. We shouldn't really
+	use the term ASCII in this class for the 8-bit-per-character buffer. Something more
+	like Latin1 would be a more accurate way to refer to it. Maybe I'll do that renaming
+	after talking to Richard about it on Monday.
+
+	Fixed a small storage leak.
+
+        * khtml/css/css_valueimpl.cpp: (CSSPrimitiveValueImpl::cleanup): Added braces to
+	fix obviously-incorrect if/else grouping.
+
 2002-08-23  Darin Adler  <darin at apple.com>
 
 	Got the kurl-test in the Tests directory working again.
diff --git a/WebCore/khtml/css/css_valueimpl.cpp b/WebCore/khtml/css/css_valueimpl.cpp
index 6c011af..b25d582 100644
--- a/WebCore/khtml/css/css_valueimpl.cpp
+++ b/WebCore/khtml/css/css_valueimpl.cpp
@@ -371,7 +371,7 @@ void CSSPrimitiveValueImpl::cleanup()
     else if(m_type < CSSPrimitiveValue::CSS_STRING || m_type == CSSPrimitiveValue::CSS_IDENT)
     { }
     else if(m_type < CSSPrimitiveValue::CSS_COUNTER)
-	if(m_value.string) m_value.string->deref();
+	{ if(m_value.string) m_value.string->deref(); }
     else if(m_type == CSSPrimitiveValue::CSS_COUNTER)
 	m_value.counter->deref();
     else if(m_type == CSSPrimitiveValue::CSS_RECT)
diff --git a/WebCore/kwq/KWQString.mm b/WebCore/kwq/KWQString.mm
index cc030c9..6737daa 100644
--- a/WebCore/kwq/KWQString.mm
+++ b/WebCore/kwq/KWQString.mm
@@ -595,6 +595,7 @@ char *QStringData::makeAscii()
                 while (i--)
                     *tp++ = *fp++;
                 str = &copyBuf[0];
+                _isUnicodeValid = 0;
             }
             else
                 str = _unicode;
@@ -615,7 +616,6 @@ char *QStringData::makeAscii()
             *cp++ = *str++;
         *cp = 0;
         
-        _isUnicodeValid = 0;
         _isAsciiValid = 1;
     }
     else if (!_isAsciiValid)
@@ -643,6 +643,7 @@ QChar *QStringData::makeUnicode()
                 while (i--)
                     *tp++ = *fp++;
                 str = &copyBuf[0];
+                _isAsciiValid = 0;
             }
             else
                 str = _ascii;
@@ -662,7 +663,6 @@ QChar *QStringData::makeUnicode()
             *cp++ = *str++;
         
         _isUnicodeValid = 1;
-        _isAsciiValid = 0;
     }
     else if (!_isUnicodeValid)
         QSTRING_FAILURE("invalid character cache");
@@ -777,7 +777,7 @@ NSString *QString::getNSString() const
     }
     
     if (dataHandle[0]->_isAsciiValid) {
-        return [NSString stringWithCString:(const char *)ascii()];
+        return [(NSString *)CFStringCreateWithCString(kCFAllocatorDefault, ascii(), kCFStringEncodingISOLatin1) autorelease];
     }
     
     QSTRING_FAILURE("invalid character cache");
@@ -2061,6 +2061,8 @@ QString &QString::insert(uint index, const char *insertChars, uint insertLength)
         
         // Insert characters.
         memcpy (targetChars+index, insertChars, insertLength);
+        
+        dataHandle[0]->_isUnicodeValid = 0;
     }
     else if (dataHandle[0]->_isUnicodeValid){
         uint originalLength = dataHandle[0]->_length;
@@ -2127,6 +2129,7 @@ QString &QString::insert(uint index, const QString &qs)
             memcpy (targetChars+index, insertChars, insertLength*sizeof(QChar));
         }
         
+        dataHandle[0]->_isAsciiValid = 0;
     }
     
     return *this;
@@ -2152,6 +2155,8 @@ QString &QString::insert(uint index, QChar qc)
         // Insert character.
         targetChars[index] = insertChar;
         targetChars[dataHandle[0]->_length] = 0;
+
+        dataHandle[0]->_isUnicodeValid = 0;
     }
     else {
         uint originalLength = dataHandle[0]->_length;
@@ -2190,6 +2195,8 @@ QString &QString::insert(uint index, char ch)
         // Insert character.
         targetChars[index] = ch;
         targetChars[dataHandle[0]->_length] = 0;
+
+        dataHandle[0]->_isUnicodeValid = 0;
     }
     else if (dataHandle[0]->_isUnicodeValid){
         uint originalLength = dataHandle[0]->_length;
@@ -2291,6 +2298,7 @@ QString &QString::remove(uint index, uint len)
             memmove( dataHandle[0]->ascii()+index, dataHandle[0]->ascii()+index+len,
                     sizeof(char)*(olen-index-len) );
             setLength( olen-len );
+            dataHandle[0]->_isUnicodeValid = 0;
         }
         else if (dataHandle[0]->_isUnicodeValid){
             memmove( dataHandle[0]->unicode()+index, dataHandle[0]->unicode()+index+len,
@@ -2416,6 +2424,7 @@ void QString::fill(QChar qc, int len)
             char *nd = (char *)ascii();
             while (len--) 
                 *nd++ = (char)qc;
+            dataHandle[0]->_isUnicodeValid = 0;
         }
         else {
             forceUnicode();
@@ -2460,6 +2469,7 @@ QString &QString::operator+=(const QString &qs)
         else 
             QSTRING_FAILURE("invalid character cache");
         dataHandle[0]->_length += qs.data()->_length;
+        dataHandle[0]->_isAsciiValid = 0;
         return *this;
     }
     else if (dataHandle[0]->_isAsciiValid && qs.data()->_isAsciiValid && dataHandle[0]->_length + qs.data()->_length < dataHandle[0]->_maxAscii){
@@ -2470,6 +2480,7 @@ QString &QString::operator+=(const QString &qs)
             *tp++ = *fp++;
         *tp = 0;
         dataHandle[0]->_length += qs.data()->_length;
+        dataHandle[0]->_isUnicodeValid = 0;
         return *this;
     }
     return insert(dataHandle[0]->_length, qs);

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list