<?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>38630</bug_id>
          
          <creation_ts>2010-05-06 01:13:06 -0700</creation_ts>
          <short_desc>VS2010 asserts a null iterator passed to std::copy in Vector::operator=</short_desc>
          <delta_ts>2010-11-04 05:47:47 -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>Web Template Framework</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows 7</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>Qt, QtTriaged</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>35784</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Jocelyn Turcotte">jturcotte</reporter>
          <assigned_to name="QtWebKit Unassigned">webkit-qt-unassigned</assigned_to>
          <cc>ap</cc>
    
    <cc>hausmann</cc>
    
    <cc>kenneth</cc>
    
    <cc>mjs</cc>
    
    <cc>tkent</cc>
    
    <cc>webkit.review.bot</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>221552</commentid>
    <comment_count>0</comment_count>
    <who name="Jocelyn Turcotte">jturcotte</who>
    <bug_when>2010-05-06 01:13:06 -0700</bug_when>
    <thetext>This happens when copying an empty Vector over another empty Vector.

Release builds works correctly.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>221555</commentid>
    <comment_count>1</comment_count>
      <attachid>55211</attachid>
    <who name="Jocelyn Turcotte">jturcotte</who>
    <bug_when>2010-05-06 01:16:18 -0700</bug_when>
    <thetext>Created attachment 55211
Patch

Fixes the assert.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>222600</commentid>
    <comment_count>2</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2010-05-07 13:58:40 -0700</bug_when>
    <thetext>It&apos;s not good for performance to add another branch. Perhaps this should only be done when building with VS2010? And a bug should probably be filed with Microsoft.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>222895</commentid>
    <comment_count>3</comment_count>
    <who name="Kent Tamura">tkent</who>
    <bug_when>2010-05-08 10:25:48 -0700</bug_when>
    <thetext>AFAIK, passing 0 to an Iterator parameter is invalid in C++. So this behavior of VS2010 seems reasonable.
If we worry about the performance, we should use &quot;#if COMPILER(MSVC)&quot; here.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>222902</commentid>
    <comment_count>4</comment_count>
    <who name="Kent Tamura">tkent</who>
    <bug_when>2010-05-08 10:43:00 -0700</bug_when>
    <thetext>I think we should add just

} else if (!other.size())
    return *this;

(No removing &quot;if (!begin()) return *this;&quot;)

This is an optimization for all compilers and solve the VS2010 issue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>222906</commentid>
    <comment_count>5</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2010-05-08 10:57:00 -0700</bug_when>
    <thetext>I do not see any restrictions on input or output iterators in copy() algorithm
description in C++ standard. Do you have a reference for this requirement?

&gt; This is an optimization for all compilers and solve the VS2010 issue.

That also sounds like an extra branch in common case. Or did I misunderstand your proposal?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>223028</commentid>
    <comment_count>6</comment_count>
    <who name="Kent Tamura">tkent</who>
    <bug_when>2010-05-09 02:58:21 -0700</bug_when>
    <thetext>(In reply to comment #5)
&gt; I do not see any restrictions on input or output iterators in copy() algorithm
&gt; description in C++ standard. Do you have a reference for this requirement?

I checked the C++0x draft, and I think i was wrong.  0 can be a valid iterator in general.

The standard says neither &quot;The OutputIterator parameter must be dereferenceable&quot; nor &quot;It may be not dereferenceable if [first, last) is empty.&quot;  So we can&apos;t assume the VS2010 behavior is a bug.

&gt; &gt; This is an optimization for all compilers and solve the VS2010 issue.
&gt; 
&gt; That also sounds like an extra branch in common case. Or did I misunderstand your proposal?

Yes, it will make an extra branch.  But it will skip the following 3-lines of the code in a case of empty vectors.
I have no strong preference on it.  I think either of it or &quot;#if COMPILER(MSVC)&quot; are ok.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>223252</commentid>
    <comment_count>7</comment_count>
      <attachid>55543</attachid>
    <who name="Jocelyn Turcotte">jturcotte</who>
    <bug_when>2010-05-10 04:53:35 -0700</bug_when>
    <thetext>Created attachment 55543
Kent&apos;s proposal patch

Here is a patch for the proposed fix.

This adds a branch when other.size() is non-zero and fits in capacity(), but exit earlier in other cases.

I would also be ok with wrapping the previous patch in a MSVC/MSVC2010 specific macro piece if you think this one has issues.

Anyhow the msvc behavior, being a bug or not, has been reported there:
https://connect.microsoft.com/VisualStudio/feedback/details/558044/std-copy-should-not-check-dest-when-first-last</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>223258</commentid>
    <comment_count>8</comment_count>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2010-05-10 05:02:02 -0700</bug_when>
    <thetext>Attachment 55543 did not pass style-queue:

Failed to run &quot;[&apos;WebKitTools/Scripts/check-webkit-style&apos;, &apos;--no-squash&apos;]&quot; exit_code: 1
JavaScriptCore/wtf/Vector.h:680:  An else if statement should be written as an if statement when the prior &quot;if&quot; concludes with a return, break, continue or goto statement.  [readability/control_flow] [4]
JavaScriptCore/wtf/Vector.h:705:  An else if statement should be written as an if statement when the prior &quot;if&quot; concludes with a return, break, continue or goto statement.  [readability/control_flow] [4]
Total errors found: 2 in 2 files


If any of these errors are false positives, please file a bug against check-webkit-style.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>223264</commentid>
    <comment_count>9</comment_count>
      <attachid>55545</attachid>
    <who name="Jocelyn Turcotte">jturcotte</who>
    <bug_when>2010-05-10 05:32:10 -0700</bug_when>
    <thetext>Created attachment 55545
Kent&apos;s proposal patch v2

Fix style issues</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>223267</commentid>
    <comment_count>10</comment_count>
      <attachid>55545</attachid>
    <who name="Kent Tamura">tkent</who>
    <bug_when>2010-05-10 06:05:14 -0700</bug_when>
    <thetext>Comment on attachment 55545
Kent&apos;s proposal patch v2

&gt; @@ -677,14 +677,17 @@ namespace WTF {
&gt;          if (&amp;other == this)
&gt;              return *this;
&gt;          
&gt; -        if (size() &gt; other.size())
&gt; +        if (size() &gt; other.size()) {
&gt;              shrink(other.size());
&gt; -        else if (other.size() &gt; capacity()) {
&gt; +            return *this;
&gt; +        }

This branch just resizes &apos;this&apos; and doesn&apos;t copy the content of &apos;other&apos;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>223361</commentid>
    <comment_count>11</comment_count>
      <attachid>55545</attachid>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2010-05-10 09:52:05 -0700</bug_when>
    <thetext>Comment on attachment 55545
Kent&apos;s proposal patch v2

&gt; The standard says neither &quot;The OutputIterator parameter must be dereferenceable&quot;
&gt; nor &quot;It may be not dereferenceable if [first, last) is empty.&quot;  So we can&apos;t
&gt; assume the VS2010 behavior is a bug.

The standard doesn&apos;t need to explicitly mention everything it allows. If there is no restriction, then it&apos;s allowed.

Please make this fix only for MSVC2010, file a bug with them, and reference this bug in a comment in code, so that we could know when to remove the workaround.

-        if (size() &gt; other.size())
+        if (size() &gt; other.size()) {
             shrink(other.size());
-        else if (other.size() &gt; capacity()) {
+            return *this;
+        }

This doesn&apos;t look like it could possibly work. Did you run regression tests with this patch? Or am I just confused?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>223362</commentid>
    <comment_count>12</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2010-05-10 09:53:01 -0700</bug_when>
    <thetext>&gt; This branch just resizes &apos;this&apos; and doesn&apos;t copy the content of &apos;other&apos;.

Sorry, didn&apos;t see your comment before reviewing. So, I&apos;m not just confused :-)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>223840</commentid>
    <comment_count>13</comment_count>
      <attachid>55682</attachid>
    <who name="Jocelyn Turcotte">jturcotte</who>
    <bug_when>2010-05-11 02:50:45 -0700</bug_when>
    <thetext>Created attachment 55682
Patch v2

(In reply to comment #11)
&gt; This doesn&apos;t look like it could possibly work. Did you run regression tests with this patch? Or am I just confused?

No, there was a lack of testing from my part on this patch, sorry about that.

Here is the first patch enclosed to apply only when the assert would pop.
Adding only &quot;else if (!other.size()) return *this;&quot; would not prevent the assert when size() &gt; other.size() and the buffer gets shrunk to 0.

See Comment #7 for a link to the reported visual studio bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>223938</commentid>
    <comment_count>14</comment_count>
      <attachid>55682</attachid>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2010-05-11 08:44:50 -0700</bug_when>
    <thetext>Comment on attachment 55682
Patch v2

+// Workarounds an assert in VS2010. See https://bugs.webkit.org/show_bug.cgi?id=38630

There is no verb &quot;workarounds&quot;, it&apos;s either a noun or &quot;works around&quot;. I still think that it would be better to have a direct link to MS issue. The use case for this comment is: can I remove this code now? - click link - read. With a Bugzilla link, there is an extra step involved. On the other hand, the Bugzilla link may be more stable.

r=me, but please fix the grammar issue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>225752</commentid>
    <comment_count>15</comment_count>
    <who name="Jocelyn Turcotte">jturcotte</who>
    <bug_when>2010-05-14 04:28:48 -0700</bug_when>
    <thetext>Committed r59463: &lt;http://trac.webkit.org/changeset/59463&gt;

Changes since the review:
- Fixed the grammar issue
- The link in the code points to the VS issue instead
- Changed the preprocessor expression to also match when _ITERATOR_DEBUG_LEVEL == 1

thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>225843</commentid>
    <comment_count>16</comment_count>
    <who name="Simon Hausmann">hausmann</who>
    <bug_when>2010-05-14 08:39:03 -0700</bug_when>
    <thetext>Revision r59463 cherry-picked into qtwebkit-2.0 with commit a1a9dda8011dbd6ffc40bad8b4e62d2d3bf95916</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>304606</commentid>
    <comment_count>17</comment_count>
    <who name="Jocelyn Turcotte">jturcotte</who>
    <bug_when>2010-11-04 05:42:22 -0700</bug_when>
    <thetext>Update:
The bug has been fixed in Visual Studio and the fix will be available in VS2011.

http://connect.microsoft.com/VisualStudio/feedback/details/558044/std-copy-should-not-check-dest-when-first-last</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>304609</commentid>
    <comment_count>18</comment_count>
    <who name="Jocelyn Turcotte">jturcotte</who>
    <bug_when>2010-11-04 05:47:47 -0700</bug_when>
    <thetext>(In reply to comment #17)
&gt; The bug has been fixed in Visual Studio and the fix will be available in VS2011.
err.. I mean VC11</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>55211</attachid>
            <date>2010-05-06 01:16:18 -0700</date>
            <delta_ts>2010-05-10 04:53:35 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>vs2010_assertfix.patch</filename>
            <type>text/plain</type>
            <size>1657</size>
            <attacher name="Jocelyn Turcotte">jturcotte</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL0phdmFTY3JpcHRDb3JlL0NoYW5nZUxvZyBiL0phdmFTY3JpcHRDb3JlL0No
YW5nZUxvZwppbmRleCA3YWRjYWM2Li4wNzExY2E3IDEwMDY0NAotLS0gYS9KYXZhU2NyaXB0Q29y
ZS9DaGFuZ2VMb2cKKysrIGIvSmF2YVNjcmlwdENvcmUvQ2hhbmdlTG9nCkBAIC0xLDMgKzEsMTMg
QEAKKzIwMTAtMDUtMDYgIEpvY2VseW4gVHVyY290dGUgIDxqb2NlbHluLnR1cmNvdHRlQG5va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oKSwgYmVnaW4oKSk7CiAgICAgICAgIFR5cGVP
cGVyYXRpb25zOjp1bmluaXRpYWxpemVkQ29weShvdGhlci5iZWdpbigpICsgc2l6ZSgpLCBvdGhl
ci5lbmQoKSwgZW5kKCkpOwogICAgICAgICBtX3NpemUgPSBvdGhlci5zaXplKCk7CkBAIC03MDUs
MTAgKzcwNSwxMCBAQCBuYW1lc3BhY2UgV1RGIHsKICAgICAgICAgZWxzZSBpZiAob3RoZXIuc2l6
ZSgpID4gY2FwYWNpdHkoKSkgewogICAgICAgICAgICAgY2xlYXIoKTsKICAgICAgICAgICAgIHJl
c2VydmVDYXBhY2l0eShvdGhlci5zaXplKCkpOwotICAgICAgICAgICAgaWYgKCFiZWdpbigpKQot
ICAgICAgICAgICAgICAgIHJldHVybiAqdGhpczsKICAgICAgICAgfQogICAgICAgICAKKyAgICAg
ICAgaWYgKCFiZWdpbigpKQorICAgICAgICAgICAgcmV0dXJuICp0aGlzOwogICAgICAgICBzdGQ6
OmNvcHkob3RoZXIuYmVnaW4oKSwgb3RoZXIuYmVnaW4oKSArIHNpemUoKSwgYmVnaW4oKSk7CiAg
ICAgICAgIFR5cGVPcGVyYXRpb25zOjp1bmluaXRpYWxpemVkQ29weShvdGhlci5iZWdpbigpICsg
c2l6ZSgpLCBvdGhlci5lbmQoKSwgZW5kKCkpOwogICAgICAgICBtX3NpemUgPSBvdGhlci5zaXpl
KCk7Cg==
</data>

          </attachment>
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>55543</attachid>
            <date>2010-05-10 04:53:35 -0700</date>
            <delta_ts>2010-05-10 05:32:10 -0700</delta_ts>
            <desc>Kent&apos;s proposal patch</desc>
            <filename>vs2010_assertfix.patch</filename>
            <type>text/plain</type>
            <size>2155</size>
            <attacher name="Jocelyn Turcotte">jturcotte</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL0phdmFTY3JpcHRDb3JlL0NoYW5nZUxvZyBiL0phdmFTY3JpcH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GlzOwogICAg
ICAgICAKLSAgICAgICAgaWYgKHNpemUoKSA+IG90aGVyLnNpemUoKSkKKyAgICAgICAgaWYgKHNp
emUoKSA+IG90aGVyLnNpemUoKSkgewogICAgICAgICAgICAgc2hyaW5rKG90aGVyLnNpemUoKSk7
Ci0gICAgICAgIGVsc2UgaWYgKG90aGVyLnNpemUoKSA+IGNhcGFjaXR5KCkpIHsKKyAgICAgICAg
ICAgIHJldHVybiAqdGhpczsKKyAgICAgICAgfSBlbHNlIGlmIChvdGhlci5zaXplKCkgPiBjYXBh
Y2l0eSgpKSB7CiAgICAgICAgICAgICBjbGVhcigpOwogICAgICAgICAgICAgcmVzZXJ2ZUNhcGFj
aXR5KG90aGVyLnNpemUoKSk7CiAgICAgICAgICAgICBpZiAoIWJlZ2luKCkpCiAgICAgICAgICAg
ICAgICAgcmV0dXJuICp0aGlzOwotICAgICAgICB9CisgICAgICAgIH0gZWxzZSBpZiAoIW90aGVy
LnNpemUoKSkKKyAgICAgICAgICAgIHJldHVybiAqdGhpczsKICAgICAgICAgCiAgICAgICAgIHN0
ZDo6Y29weShvdGhlci5iZWdpbigpLCBvdGhlci5iZWdpbigpICsgc2l6ZSgpLCBiZWdpbigpKTsK
ICAgICAgICAgVHlwZU9wZXJhdGlvbnM6OnVuaW5pdGlhbGl6ZWRDb3B5KG90aGVyLmJlZ2luKCkg
KyBzaXplKCksIG90aGVyLmVuZCgpLCBlbmQoKSk7CkBAIC03MDAsMTQgKzcwMiwxNiBAQCBuYW1l
c3BhY2UgV1RGIHsKICAgICAgICAgaWYgKCZvdGhlciA9PSB0aGlzKQogICAgICAgICAgICAgcmV0
dXJuICp0aGlzOwogICAgICAgICAKLSAgICAgICAgaWYgKHNpemUoKSA+IG90aGVyLnNpemUoKSkK
KyAgICAgICAgaWYgKHNpemUoKSA+IG90aGVyLnNpemUoKSkgewogICAgICAgICAgICAgc2hyaW5r
KG90aGVyLnNpemUoKSk7Ci0gICAgICAgIGVsc2UgaWYgKG90aGVyLnNpemUoKSA+IGNhcGFjaXR5
KCkpIHsKKyAgICAgICAgICAgIHJldHVybiAqdGhpczsKKyAgICAgICAgfSBlbHNlIGlmIChvdGhl
ci5zaXplKCkgPiBjYXBhY2l0eSgpKSB7CiAgICAgICAgICAgICBjbGVhcigpOwogICAgICAgICAg
ICAgcmVzZXJ2ZUNhcGFjaXR5KG90aGVyLnNpemUoKSk7CiAgICAgICAgICAgICBpZiAoIWJlZ2lu
KCkpCiAgICAgICAgICAgICAgICAgcmV0dXJuICp0aGlzOwotICAgICAgICB9CisgICAgICAgIH0g
ZWxzZSBpZiAoIW90aGVyLnNpemUoKSkKKyAgICAgICAgICAgIHJldHVybiAqdGhpczsKICAgICAg
ICAgCiAgICAgICAgIHN0ZDo6Y29weShvdGhlci5iZWdpbigpLCBvdGhlci5iZWdpbigpICsgc2l6
ZSgpLCBiZWdpbigpKTsKICAgICAgICAgVHlwZU9wZXJhdGlvbnM6OnVuaW5pdGlhbGl6ZWRDb3B5
KG90aGVyLmJlZ2luKCkgKyBzaXplKCksIG90aGVyLmVuZCgpLCBlbmQoKSk7Cg==
</data>

          </attachment>
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>55545</attachid>
            <date>2010-05-10 05:32:10 -0700</date>
            <delta_ts>2010-05-11 02:50:45 -0700</delta_ts>
            <desc>Kent&apos;s proposal patch v2</desc>
            <filename>vs2010_assertfix.patch</filename>
            <type>text/plain</type>
            <size>2163</size>
            <attacher name="Jocelyn Turcotte">jturcotte</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL0phdmFTY3JpcHRDb3JlL0NoYW5nZUxvZyBiL0phdmFTY3JpcHRDb3JlL0No
YW5nZUxvZwppbmRleCBlYjJmOTdkLi4wMjFmNGEwIDEwMDY0NAotLS0gYS9KYXZhU2NyaXB0Q29y
ZS9DaGFuZ2VMb2cKKysrIGIvSmF2YVNjcmlwdENvcmUvQ2hhbmdlTG9nCkBAIC0xLDMgKzEsMTU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sc2UgaWYgKG90aGVyLnNpemUoKSA+IGNhcGFjaXR5KCkpIHsKKyAgICAgICAg
ICAgIHJldHVybiAqdGhpczsKKyAgICAgICAgfQorICAgICAgICBpZiAob3RoZXIuc2l6ZSgpID4g
Y2FwYWNpdHkoKSkgewogICAgICAgICAgICAgY2xlYXIoKTsKICAgICAgICAgICAgIHJlc2VydmVD
YXBhY2l0eShvdGhlci5zaXplKCkpOwogICAgICAgICAgICAgaWYgKCFiZWdpbigpKQogICAgICAg
ICAgICAgICAgIHJldHVybiAqdGhpczsKLSAgICAgICAgfQorICAgICAgICB9IGVsc2UgaWYgKCFv
dGhlci5zaXplKCkpCisgICAgICAgICAgICByZXR1cm4gKnRoaXM7CiAgICAgICAgIAogICAgICAg
ICBzdGQ6OmNvcHkob3RoZXIuYmVnaW4oKSwgb3RoZXIuYmVnaW4oKSArIHNpemUoKSwgYmVnaW4o
KSk7CiAgICAgICAgIFR5cGVPcGVyYXRpb25zOjp1bmluaXRpYWxpemVkQ29weShvdGhlci5iZWdp
bigpICsgc2l6ZSgpLCBvdGhlci5lbmQoKSwgZW5kKCkpOwpAQCAtNzAwLDE0ICs3MDMsMTcgQEAg
bmFtZXNwYWNlIFdURiB7CiAgICAgICAgIGlmICgmb3RoZXIgPT0gdGhpcykKICAgICAgICAgICAg
IHJldHVybiAqdGhpczsKICAgICAgICAgCi0gICAgICAgIGlmIChzaXplKCkgPiBvdGhlci5zaXpl
KCkpCisgICAgICAgIGlmIChzaXplKCkgPiBvdGhlci5zaXplKCkpIHsKICAgICAgICAgICAgIHNo
cmluayhvdGhlci5zaXplKCkpOwotICAgICAgICBlbHNlIGlmIChvdGhlci5zaXplKCkgPiBjYXBh
Y2l0eSgpKSB7CisgICAgICAgICAgICByZXR1cm4gKnRoaXM7CisgICAgICAgIH0KKyAgICAgICAg
aWYgKG90aGVyLnNpemUoKSA+IGNhcGFjaXR5KCkpIHsKICAgICAgICAgICAgIGNsZWFyKCk7CiAg
ICAgICAgICAgICByZXNlcnZlQ2FwYWNpdHkob3RoZXIuc2l6ZSgpKTsKICAgICAgICAgICAgIGlm
ICghYmVnaW4oKSkKICAgICAgICAgICAgICAgICByZXR1cm4gKnRoaXM7Ci0gICAgICAgIH0KKyAg
ICAgICAgfSBlbHNlIGlmICghb3RoZXIuc2l6ZSgpKQorICAgICAgICAgICAgcmV0dXJuICp0aGlz
OwogICAgICAgICAKICAgICAgICAgc3RkOjpjb3B5KG90aGVyLmJlZ2luKCksIG90aGVyLmJlZ2lu
KCkgKyBzaXplKCksIGJlZ2luKCkpOwogICAgICAgICBUeXBlT3BlcmF0aW9uczo6dW5pbml0aWFs
aXplZENvcHkob3RoZXIuYmVnaW4oKSArIHNpemUoKSwgb3RoZXIuZW5kKCksIGVuZCgpKTsK
</data>
<flag name="review"
          id="39755"
          type_id="1"
          status="-"
          setter="ap"
    />
    <flag name="commit-queue"
          id="39756"
          type_id="3"
          status="-"
          setter="ap"
    />
          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>55682</attachid>
            <date>2010-05-11 02:50:45 -0700</date>
            <delta_ts>2010-05-11 08:44:49 -0700</delta_ts>
            <desc>Patch v2</desc>
            <filename>vs2010_assertfix.patch</filename>
            <type>text/plain</type>
            <size>1771</size>
            <attacher name="Jocelyn Turcotte">jturcotte</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL0phdmFTY3JpcHRDb3JlL0NoYW5nZUxvZyBiL0phdmFTY3JpcHRDb3JlL0No
YW5nZUxvZwppbmRleCBlYjJmOTdkLi4wMjFmNGEwIDEwMDY0NAotLS0gYS9KYXZhU2NyaXB0Q29y
ZS9DaGFuZ2VMb2cKKysrIGIvSmF2YVNjcmlwdENvcmUvQ2hhbmdlTG9nCkBAIC0xLDMgKzEsMTUg
QEAKKzIwMTAtMDUtMTAgIEpvY2VseW4gVHVyY290dGUgIDxqb2NlbHluLnR1cmNvdHRlQG5va2lh
LmNvbT4KKworICAgICAgICBSZXZpZ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ZXR1cm4gKnRoaXM7CisjZW5kaWYKKwogICAgICAg
ICBzdGQ6OmNvcHkob3RoZXIuYmVnaW4oKSwgb3RoZXIuYmVnaW4oKSArIHNpemUoKSwgYmVnaW4o
KSk7CiAgICAgICAgIFR5cGVPcGVyYXRpb25zOjp1bmluaXRpYWxpemVkQ29weShvdGhlci5iZWdp
bigpICsgc2l6ZSgpLCBvdGhlci5lbmQoKSwgZW5kKCkpOwogICAgICAgICBtX3NpemUgPSBvdGhl
ci5zaXplKCk7CkBAIC03MDksNiArNzE1LDEyIEBAIG5hbWVzcGFjZSBXVEYgewogICAgICAgICAg
ICAgICAgIHJldHVybiAqdGhpczsKICAgICAgICAgfQogICAgICAgICAKKy8vIFdvcmthcm91bmRz
IGFuIGFzc2VydCBpbiBWUzIwMTAuIFNlZSBodHRwczovL2J1Z3Mud2Via2l0Lm9yZy9zaG93X2J1
Zy5jZ2k/aWQ9Mzg2MzAKKyNpZiBDT01QSUxFUihNU1ZDKSAmJiBkZWZpbmVkKF9JVEVSQVRPUl9E
RUJVR19MRVZFTCkgJiYgX0lURVJBVE9SX0RFQlVHX0xFVkVMID4gMQorICAgICAgICBpZiAoIWJl
Z2luKCkpCisgICAgICAgICAgICByZXR1cm4gKnRoaXM7CisjZW5kaWYKKwogICAgICAgICBzdGQ6
OmNvcHkob3RoZXIuYmVnaW4oKSwgb3RoZXIuYmVnaW4oKSArIHNpemUoKSwgYmVnaW4oKSk7CiAg
ICAgICAgIFR5cGVPcGVyYXRpb25zOjp1bmluaXRpYWxpemVkQ29weShvdGhlci5iZWdpbigpICsg
c2l6ZSgpLCBvdGhlci5lbmQoKSwgZW5kKCkpOwogICAgICAgICBtX3NpemUgPSBvdGhlci5zaXpl
KCk7Cg==
</data>
<flag name="review"
          id="39928"
          type_id="1"
          status="+"
          setter="ap"
    />
    <flag name="commit-queue"
          id="39929"
          type_id="3"
          status="-"
          setter="ap"
    />
          </attachment>
      

    </bug>

</bugzilla>