<?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>43841</bug_id>
          
          <creation_ts>2010-08-11 03:02:13 -0700</creation_ts>
          <short_desc>SegmentedVector::operator== typo</short_desc>
          <delta_ts>2011-08-12 16:10:45 -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="andreyf">andrey154</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>barraclough</cc>
    
    <cc>darin</cc>
    
    <cc>ggaren</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>263145</commentid>
    <comment_count>0</comment_count>
    <who name="andreyf">andrey154</who>
    <bug_when>2010-08-11 03:02:13 -0700</bug_when>
    <thetext>WTF::SegmentedVector::operator== (in file webkit\JavaScriptCore\wtf\SegmentedVector.h:70) has typo:
        bool operator==(const Iterator&amp; other) const
        {
            return (m_index == other.m_index &amp;&amp; m_segment = other.m_segment &amp;&amp; &amp;m_vector == &amp;other.m_vector); // HERE: m_segment _=_ other.m_segment
        }

This should be:
        bool operator==(const Iterator&amp; other) const
        {
            return (m_index == other.m_index &amp;&amp; m_segment == other.m_segment &amp;&amp; &amp;m_vector == &amp;other.m_vector);
        }

Because normaly operator== should be ! operator!=.

        bool operator!=(const Iterator&amp; other) const
        {
            return (m_index != other.m_index || m_segment != other.m_segment || &amp;m_vector != &amp;other.m_vector); // NOTE: m_segment _!=_ other.m_segment 
        }

I don&apos;t know consequences of this.

Kind regards,
Andrey</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>263269</commentid>
    <comment_count>1</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2010-08-11 08:58:23 -0700</bug_when>
    <thetext>Looks bad! I wonder what the symptom is.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>263318</commentid>
    <comment_count>2</comment_count>
    <who name="Geoffrey Garen">ggaren</who>
    <bug_when>2010-08-11 10:10:17 -0700</bug_when>
    <thetext>It looks like the operator isn&apos;t used. I&apos;d suggest removing it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>263634</commentid>
    <comment_count>3</comment_count>
    <who name="andreyf">andrey154</who>
    <bug_when>2010-08-12 00:27:04 -0700</bug_when>
    <thetext>(In reply to comment #1)
&gt; Looks bad! I wonder what the symptom is.

Darin, unfortunately, this was found by my code intrumentation utility and i don&apos;t have time to compose a unit test to reproduce erroneous behaviour.
I promise to try later.
Why don&apos;t change this to something like:
        bool operator==(const Iterator&amp; other) const
        {
            return ! operator!= (other);
        }
It will not consume much code space and provide full external interface to SegmentedVector. 

Kind regards,
Andrey</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>263897</commentid>
    <comment_count>4</comment_count>
    <who name="Geoffrey Garen">ggaren</who>
    <bug_when>2010-08-12 11:37:55 -0700</bug_when>
    <thetext>I&apos;m not keen on having unused / untested code in the tree. It leads to bitrot like this.

If you plan on using this function, that&apos;s a different story.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>263911</commentid>
    <comment_count>5</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2010-08-12 12:22:38 -0700</bug_when>
    <thetext>Yes, lets remove the function as Geoff suggests.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>420952</commentid>
    <comment_count>6</comment_count>
    <who name="Gavin Barraclough">barraclough</who>
    <bug_when>2011-06-14 18:58:08 -0700</bug_when>
    <thetext>Fixed in r88892.  (These operators are used by the DFG JIT).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>450739</commentid>
    <comment_count>7</comment_count>
    <who name="Gavin Barraclough">barraclough</who>
    <bug_when>2011-08-12 16:10:45 -0700</bug_when>
    <thetext>*** Bug 56289 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>