Bug 125122 - DFG logic mixes boolean and binary operations
Summary: DFG logic mixes boolean and binary operations
Status: RESOLVED DUPLICATE of bug 135205
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Mark Lam
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-12-02 16:56 PST by Brent Fulgham
Modified: 2015-02-02 16:32 PST (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Brent Fulgham 2013-12-02 16:56:37 PST
DFGCommon generates a bunch of warnings when built under Windows:

7>c:\projects\webkit\opensource\source\javascriptcore\dfg\DFGCommon.h(216): warning C4805: '==' : unsafe mix of type 'bool' and type 'int' in operation
7>          c:\projects\webkit\opensource\source\javascriptcore\dfg\DFGVariableAccessData.h(96) : see reference to function template instantiation 'bool JSC::DFG::checkAndSet<bool,int>(T &,U)' being compiled

The offending code in DFGVariableAccessData looks like this:

    bool mergeIsCaptured(bool isCaptured)
    {
        return checkAndSet(m_shouldNeverUnbox, m_shouldNeverUnbox | isCaptured)
            | checkAndSet(m_isCaptured, m_isCaptured | isCaptured);
    }


MSVC seems to be promoting the two boolean types in the binary OR operation (e.g., m_shouldNeverUnbox | isCaptured) to integer type, which is then passed to checkAndSet, resulting in a comparison of bool to integer.

Probably harmless, but an annoying warning.
Comment 1 Brent Fulgham 2015-02-02 14:47:07 PST
I think Mark fixed this already. Can you confirm?
Comment 2 Mark Lam 2015-02-02 16:29:59 PST
Yes, this is fixed already in ToT.
Comment 3 Mark Lam 2015-02-02 16:32:05 PST
(In reply to comment #2)
> Yes, this is fixed already in ToT.

Specifically, this was fixed for https://bugs.webkit.org/show_bug.cgi?id=135205 in http://trac.webkit.org/changeset/174371.

*** This bug has been marked as a duplicate of bug 135205 ***