Bug 34772 - New assertion in UStringImpl::create() is overzealous
Summary: New assertion in UStringImpl::create() is overzealous
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: John Sullivan
URL: http://www.salon.com/technology/the_g...
Keywords:
Depends on:
Blocks:
 
Reported: 2010-02-09 11:57 PST by John Sullivan
Modified: 2010-02-09 13:52 PST (History)
2 users (show)

See Also:


Attachments
Patch to only assert that vector.data() is non-empty if vector.size() is non-zero. (1.36 KB, patch)
2010-02-09 12:02 PST, John Sullivan
abarth: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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