Bug 34772

Summary: New assertion in UStringImpl::create() is overzealous
Product: WebKit Reporter: John Sullivan <sullivan>
Component: JavaScriptCoreAssignee: John Sullivan <sullivan>
Status: RESOLVED FIXED    
Severity: Normal CC: barraclough, ggaren
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
URL: http://www.salon.com/technology/the_gigaom_network/gadget_gurus/2010/02/09/will_notion_inks_adam_be_the_ipad_for_geeks
Attachments:
Description Flags
Patch to only assert that vector.data() is non-empty if vector.size() is non-zero. abarth: review+

Description John Sullivan 2010-02-09 11:57:31 PST
I keep hitting the following assertion in UStringImpl::create(), which was introduced in r54545:

            ASSERT(vector.data());

This function is sometimes legitimately called with an empty vector. It behaves correctly when called with an empty vector, because it special-cases for a vector.size() result of 0 and returns &empty() in that case.
Comment 1 John Sullivan 2010-02-09 12:01:03 PST
The assertion is in UStringImpl::adopt(), not UStringImpl::create(). I'll have a patch in a moment.
Comment 2 John Sullivan 2010-02-09 12:02:47 PST
Created attachment 48435 [details]
Patch to only assert that vector.data() is non-empty if vector.size() is non-zero.
Comment 3 Adam Barth 2010-02-09 12:04:46 PST
Comment on attachment 48435 [details]
Patch to only assert that vector.data() is non-empty if vector.size() is non-zero.

ok
Comment 4 Geoffrey Garen 2010-02-09 12:06:23 PST
CC'ing Gavin, since he introduced the ASSERT.
Comment 5 John Sullivan 2010-02-09 13:52:48 PST
Fixed in http://trac.webkit.org/changeset/54563