<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>34772</bug_id>
          
          <creation_ts>2010-02-09 11:57:31 -0800</creation_ts>
          <short_desc>New assertion in UStringImpl::create() is overzealous</short_desc>
          <delta_ts>2010-02-09 13:52:48 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>JavaScriptCore</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc>http://www.salon.com/technology/the_gigaom_network/gadget_gurus/2010/02/09/will_notion_inks_adam_be_the_ipad_for_geeks</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="John Sullivan">sullivan</reporter>
          <assigned_to name="John Sullivan">sullivan</assigned_to>
          <cc>barraclough</cc>
    
    <cc>ggaren</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>189099</commentid>
    <comment_count>0</comment_count>
    <who name="John Sullivan">sullivan</who>
    <bug_when>2010-02-09 11:57:31 -0800</bug_when>
    <thetext>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 &amp;empty() in that case.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>189104</commentid>
    <comment_count>1</comment_count>
    <who name="John Sullivan">sullivan</who>
    <bug_when>2010-02-09 12:01:03 -0800</bug_when>
    <thetext>The assertion is in UStringImpl::adopt(), not UStringImpl::create(). I&apos;ll have a patch in a moment.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>189107</commentid>
    <comment_count>2</comment_count>
      <attachid>48435</attachid>
    <who name="John Sullivan">sullivan</who>
    <bug_when>2010-02-09 12:02:47 -0800</bug_when>
    <thetext>Created attachment 48435
Patch to only assert that vector.data() is non-empty if vector.size() is non-zero.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>189109</commentid>
    <comment_count>3</comment_count>
      <attachid>48435</attachid>
    <who name="Adam Barth">abarth</who>
    <bug_when>2010-02-09 12:04:46 -0800</bug_when>
    <thetext>Comment on attachment 48435
Patch to only assert that vector.data() is non-empty if vector.size() is non-zero.

ok</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>189111</commentid>
    <comment_count>4</comment_count>
    <who name="Geoffrey Garen">ggaren</who>
    <bug_when>2010-02-09 12:06:23 -0800</bug_when>
    <thetext>CC&apos;ing Gavin, since he introduced the ASSERT.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>189143</commentid>
    <comment_count>5</comment_count>
    <who name="John Sullivan">sullivan</who>
    <bug_when>2010-02-09 13:52:48 -0800</bug_when>
    <thetext>Fixed in http://trac.webkit.org/changeset/54563</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>48435</attachid>
            <date>2010-02-09 12:02:47 -0800</date>
            <delta_ts>2010-02-09 12:04:45 -0800</delta_ts>
            <desc>Patch to only assert that vector.data() is non-empty if vector.size() is non-zero.</desc>
            <filename>34772_patch.txt</filename>
            <type>text/plain</type>
            <size>1393</size>
            <attacher name="John Sullivan">sullivan</attacher>
            
              <data encoding="base64">SW5kZXg6IEphdmFTY3JpcHRDb3JlL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT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JpcHRDb3JlL3J1bnRpbWUv
VVN0cmluZ0ltcGwuaAkod29ya2luZyBjb3B5KQpAQCAtODcsOSArODcsMTAgQEAgcHVibGljOgog
ICAgIHRlbXBsYXRlPHNpemVfdCBpbmxpbmVDYXBhY2l0eT4KICAgICBzdGF0aWMgUGFzc1JlZlB0
cjxVU3RyaW5nSW1wbD4gYWRvcHQoVmVjdG9yPFVDaGFyLCBpbmxpbmVDYXBhY2l0eT4mIHZlY3Rv
cikKICAgICB7Ci0gICAgICAgIEFTU0VSVCh2ZWN0b3IuZGF0YSgpKTsKLSAgICAgICAgaWYgKHVu
c2lnbmVkIGxlbmd0aCA9IHZlY3Rvci5zaXplKCkpCisgICAgICAgIGlmICh1bnNpZ25lZCBsZW5n
dGggPSB2ZWN0b3Iuc2l6ZSgpKSB7CisgICAgICAgICAgICBBU1NFUlQodmVjdG9yLmRhdGEoKSk7
CiAgICAgICAgICAgICByZXR1cm4gYWRvcHRSZWYobmV3IFVTdHJpbmdJbXBsKHZlY3Rvci5yZWxl
YXNlQnVmZmVyKCksIGxlbmd0aCwgQnVmZmVyT3duZWQpKTsKKyAgICAgICAgfQogICAgICAgICBy
ZXR1cm4gJmVtcHR5KCk7CiAgICAgfQogCg==
</data>
<flag name="review"
          id="31121"
          type_id="1"
          status="+"
          setter="abarth"
    />
          </attachment>
      

    </bug>

</bugzilla>