[Webkit-unassigned] [Bug 65944] Crash in QuotesData::operator== when compiled with RVCT

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Aug 10 08:02:24 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=65944





--- Comment #13 from Yong Li <yong.li.webkit at gmail.com>  2011-08-10 08:02:24 PST ---
(In reply to comment #12)
> (From update of attachment 103489 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=103489&action=review
> 
> > Source/WebCore/rendering/style/QuotesData.h:37
> > -    bool operator==(const QuotesData&) const;
> >      void operator delete(void* p) { delete[] static_cast<char*>(p); }
> > +    static bool equal(const QuotesData*, const QuotesData*);
> 
> Should we add a comment about avoiding "==" so no one tries to get it back in?

operator== is not a problem. The problem is the old operator== is bad written. It checks "this" pointer and the address of a reference (QuotesData&), and expects to work with null "this" and a reference deferencing a null pointer.

If someone in the future wants to write a normal operator==, and doesn't use operator== on null pointers, it should be fine.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list