[Webkit-unassigned] [Bug 213448] New: On 64bit build, JSValue::operator bool maybe wrong.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Jun 21 19:03:21 PDT 2020


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

            Bug ID: 213448
           Summary: On 64bit build, JSValue::operator bool maybe wrong.
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: JavaScriptCore
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: xc.o.c.1180 at gmail.com

On 32bit build, JSValue::operator bool checks not empty value.

On 64bit build, JSValue::operator bool checks not null pointer.

Also on 32bit build, when passing null pointer JSCell, an empty value is created.

Should 64bit build do the same thing?

ALWAYS_INLINE JSValue::JSValue(JSCell* ptr)
{
        if (LIKELY(ptr != 0))
                u.asInt64 = reinterpret_cast<uintptr_t>(ptr);
        else
                u.asInt64 = ValueEmpty;
}

ALWAYS_INLINE JSValue::JSValue(const JSCell* ptr)
{
        if (LIKELY(ptr != 0))
                u.asInt64 = reinterpret_cast<uintptr_t>(const_cast<JSCell*>(ptr));
        else
                u.asInt64 = ValueEmpty;
}

inline JSValue::operator bool() const
{
    return u.asInt64 != ValueEmpty;
}

Please take a look.


Thanks.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20200622/50243494/attachment.htm>


More information about the webkit-unassigned mailing list