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

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Aug 11 07:14:48 PDT 2011


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





--- Comment #15 from Yong Li <yong.li.webkit at gmail.com>  2011-08-11 07:14:47 PST ---
(In reply to comment #14)
> > The problem is the old operator== is bad written 
> 
> Are you sure that the blame is pointed correctly here? Seems like a bug in this particular compiler to me.

This was discussed @ https://bugs.webkit.org/show_bug.cgi?id=36901

from [Daniel Bates]:

By 8.3.2 (5) of the C++ standard <http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3092.pdf>:

A reference shall be initialized to refer to a valid object or function. [ Note: in particular, a null reference cannot exist in a well-defined program, because the only way to create such a reference would be to bind it to the “object” obtained by dereferencing a null pointer, which causes undefined behavior....]

RVCT uses a strict interpretation of the standard (compared to GCC) and assumes a reference must always be initialized with a valid object. Hence it optimizes away !&other.

Another one is "!this". Although RVCT has a compiler option "--allow_null_this", we should still avoid writing such code.

-- 
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