<?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>99230</bug_id>
          
          <creation_ts>2012-10-12 18:33:00 -0700</creation_ts>
          <short_desc>StringPrototype::jsSpliceSubstringsWithSeparators() doesn&apos;t optimally handle 8 bit strings</short_desc>
          <delta_ts>2012-10-17 14:54:51 -0700</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></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="Michael Saboff">msaboff</reporter>
          <assigned_to name="Michael Saboff">msaboff</assigned_to>
          <cc>webkit.review.bot</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>741378</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Saboff">msaboff</who>
    <bug_when>2012-10-12 18:33:00 -0700</bug_when>
    <thetext>jsSpliceSubstringsWithSeparators() handles the case where both the source an separators are all 8 bit strings, but doesn&apos;t handle when they are mixed sizes.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>741379</commentid>
    <comment_count>1</comment_count>
      <attachid>168528</attachid>
    <who name="Michael Saboff">msaboff</who>
    <bug_when>2012-10-12 18:36:18 -0700</bug_when>
    <thetext>Created attachment 168528
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>742322</commentid>
    <comment_count>2</comment_count>
      <attachid>168528</attachid>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2012-10-15 12:51:33 -0700</bug_when>
    <thetext>Comment on attachment 168528
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=168528&amp;action=review

&gt; Source/JavaScriptCore/runtime/StringPrototype.cpp:404
&gt; +                    StringImpl::copyChars(buffer + bufferPos, separators[i].characters8(), sepLen);
&gt; +                else
&gt; +                    StringImpl::copyChars(buffer + bufferPos, separators[i].characters16(), sepLen);

Why not just have a StringImpl::copyChars() which takes a StringImpl and does this if internally?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>743671</commentid>
    <comment_count>3</comment_count>
    <who name="Michael Saboff">msaboff</who>
    <bug_when>2012-10-16 16:17:52 -0700</bug_when>
    <thetext>(In reply to comment #2)
&gt; (From update of attachment 168528 [details])
&gt; View in context: https://bugs.webkit.org/attachment.cgi?id=168528&amp;action=review
&gt; 
&gt; &gt; Source/JavaScriptCore/runtime/StringPrototype.cpp:404
&gt; &gt; +                    StringImpl::copyChars(buffer + bufferPos, separators[i].characters8(), sepLen);
&gt; &gt; +                else
&gt; &gt; +                    StringImpl::copyChars(buffer + bufferPos, separators[i].characters16(), sepLen);
&gt; 
&gt; Why not just have a StringImpl::copyChars() which takes a StringImpl and does this if internally?

We would likely need a few flavors.  This flavor would use the string length, but at least another one would need a string offset and a reduced length.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>744642</commentid>
    <comment_count>4</comment_count>
      <attachid>168528</attachid>
    <who name="Geoffrey Garen">ggaren</who>
    <bug_when>2012-10-17 14:48:19 -0700</bug_when>
    <thetext>Comment on attachment 168528
Patch

r=me</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>744655</commentid>
    <comment_count>5</comment_count>
      <attachid>168528</attachid>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2012-10-17 14:54:47 -0700</bug_when>
    <thetext>Comment on attachment 168528
Patch

Clearing flags on attachment: 168528

Committed r131648: &lt;http://trac.webkit.org/changeset/131648&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>744656</commentid>
    <comment_count>6</comment_count>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2012-10-17 14:54:51 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>168528</attachid>
            <date>2012-10-12 18:36:18 -0700</date>
            <delta_ts>2012-10-17 14:54:47 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>99230.patch</filename>
            <type>text/plain</type>
            <size>2321</size>
            <attacher name="Michael Saboff">msaboff</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9KYXZhU2NyaXB0Q29yZS9DaGFuZ2VMb2cKPT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gU291
cmNlL0phdmFTY3JpcHRDb3JlL0NoYW5nZUxvZwkocmV2aXNpb24gMTMxMjQ4KQorKysgU291cmNl
L0phdmFTY3JpcHRDb3JlL0NoYW5nZUxvZwkod29ya2luZyBjb3B5KQpAQCAtMSwzICsxLDE2IEBA
CisyMDEyLTEwLTEyICBNaWNoYWVsIFNhYm9mZiAgPG1zYWJvZmZAYXBwbGUuY29tPgorCisgICAg
ICAgIFN0cmluZ1Byb3RvdHlwZTo6anNTcGxpY2VTdWJzdHJpbmdzV2l0aFNlcGFyYXRvcnMoKSBk
b2Vzbid0IG9wdGltYWxseSBoYW5kbGUgOCBiaXQgc3RyaW5ncworICAgICAgICBodHRwczovL2J1
Z3Mud2Via2l0Lm9yZy9zaG93X2J1Zy5jZ2k/aWQ9OTkyMzAKKworICAgICAgICBSZXZpZXdlZCBi
eSBOT0JPRFkgKE9PUFMhKS4KKworICAgICAgICBBZGRlZCBjb2RlIHRvIHNlbGVjd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gICBlbHNlCisgICAgICAgICAg
ICAgICAgICAgIFN0cmluZ0ltcGw6OmNvcHlDaGFycyhidWZmZXIgKyBidWZmZXJQb3MsIHNlcGFy
YXRvcnNbaV0uY2hhcmFjdGVyczE2KCksIHNlcExlbik7CiAgICAgICAgICAgICAgICAgYnVmZmVy
UG9zICs9IHNlcExlbjsKICAgICAgICAgICAgIH0KICAgICAgICAgfQo=
</data>

          </attachment>
      

    </bug>

</bugzilla>