[Webkit-unassigned] [Bug 198014] aarch64: ‘JSC::ARM64Assembler::LinkRecord::<unnamed union>::RealTypes::m_compareRegister’ is too small to hold all values of ‘JSC::ARM64Assembler::RegisterID’ {aka ‘enum JSC::ARM64Registers::RegisterID’}

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Jun 5 13:24:03 PDT 2019


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

Michael Catanzaro <mcatanzaro at igalia.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |Hironori.Fujii at sony.com,
                   |                            |mark.lam at apple.com,
                   |                            |ysuzuki at apple.com

--- Comment #2 from Michael Catanzaro <mcatanzaro at igalia.com> ---
CCing people who have touched this code before. Looks like this is a sequel to bug #135906. The enum is:

typedef enum : int8_t {
    // Parameter/result registers.
    x0,
    x1,
    x2,
    x3,
    x4,
    x5,
    x6,
    x7,
    // Indirect result location register.
    x8,
    // Temporary registers.
    x9,
    x10,
    x11,
    x12,
    x13,
    x14,
    x15,
    // Intra-procedure-call scratch registers (temporary).
    x16,
    x17,
    // Platform Register (temporary).
    x18,
    // Callee-saved.
    x19,
    x20,
    x21,
    x22,
    x23,
    x24,
    x25,
    x26,
    x27,
    x28,
    // Special.
    fp,
    lr,
    sp,

    ip0 = x16,
    ip1 = x17,
    x29 = fp,
    x30 = lr,
    zr = 0x3f, // <-- problem is here
    InvalidGPRReg = -1,
} RegisterID;

The bitfield is six bits large, so only 32 values are allowed. But 0x3f is 63 decimal. It just doesn't fit. I think actually only 16 nonnegative values are allowed, because it's signed. So yeah, I don't understand how this could work properly without clobbering.

Expanding the bitfield to seven bits is not enough. 8 bits makes the warning go away.

We might not want it to be a bitfield at all at 8 bits, since it's an int8_t enum anyway, but just changing it to eight bits suffices.

-- 
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/20190605/78cdfe95/attachment.html>


More information about the webkit-unassigned mailing list