RESOLVED FIXED 34772
New assertion in UStringImpl::create() is overzealous
https://bugs.webkit.org/show_bug.cgi?id=34772
Summary New assertion in UStringImpl::create() is overzealous
John Sullivan
Reported 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.
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+
John Sullivan
Comment 1 2010-02-09 12:01:03 PST
The assertion is in UStringImpl::adopt(), not UStringImpl::create(). I'll have a patch in a moment.
John Sullivan
Comment 2 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.
Adam Barth
Comment 3 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
Geoffrey Garen
Comment 4 2010-02-09 12:06:23 PST
CC'ing Gavin, since he introduced the ASSERT.
John Sullivan
Comment 5 2010-02-09 13:52:48 PST
Note You need to log in before you can comment on or make changes to this bug.