[Webkit-unassigned] [Bug 214142] [WTF] Fix PackedAlignedPtr for X86_64 canonical addresses

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jul 9 10:08:42 PDT 2020


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

--- Comment #9 from Mark Lam <mark.lam at apple.com> ---
Comment on attachment 403873
  --> https://bugs.webkit.org/attachment.cgi?id=403873
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=403873&action=review

> Source/WTF/wtf/Packed.h:155
> +#if CPU(X86_64)
> +        // The AMD specification requires that the most significant 16
> +        // bits of any virtual address, bits 48 through 63, must be
> +        // copies of bit 47 (in a manner akin to sign extension).
> +        //
> +        // Reference: https://en.wikipedia.org/wiki/X86-64#Virtual_address_space_details
> +        if (value & 0x1ULL << 47)
> +            value |= 0xffffULL << 48;
> +#endif

Please add an ASSERT in set() to verify that if bit 47 is set that the upper 16 bits are also set.

-- 
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/20200709/4095fa0b/attachment.htm>


More information about the webkit-unassigned mailing list