Bug 125102
Summary: | [Win] (32-bit) Warning about truncated constant value in X86Assembler | ||
---|---|---|---|
Product: | WebKit | Reporter: | Brent Fulgham <bfulgham> |
Component: | JavaScriptCore | Assignee: | Mark Lam <mark.lam> |
Status: | NEW | ||
Severity: | Normal | CC: | bfulgham, mark.lam, msaboff, peavo |
Priority: | P2 | ||
Version: | 528+ (Nightly build) | ||
Hardware: | Unspecified | ||
OS: | Unspecified |
Brent Fulgham
Building JavaScriptCore on Windows shows the following warning (dozens of times) during a 32-bit build:
6>c:\projects\webkit\opensource\webkitbuild\release\include\private\javascriptcore\X86Assembler.h(2342): warning C4309: 'argument' : truncation of constant value
The code generating the error is:
void threeByteOp(ThreeByteOpcodeID opcode)
{
m_buffer.ensureSpace(maxInstructionSize);
m_buffer.putByteUnchecked(OP_2BYTE_ESCAPE);
>>> m_buffer.putByteUnchecked(OP2_3BYTE_ESCAPE);
m_buffer.putByteUnchecked(opcode);
}
The "putByteUnchecked" takes a signed int8_t value.
void putByteUnchecked(int8_t value) { putIntegralUnchecked(value); }
OP2_3BYTE_ESCAPE is defined as:
OP2_3BYTE_ESCAPE = 0xAE
This resolves to decimal 174, which is outside the allowed range of -128 to +127.
I'm not aware of this causing any functional problems, but the warning is annoying, and might signify something bad if the compiler decided to pass (11010001) "-47" instead of (10101110) "+174".
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Brent Fulgham
I think this has been fixed in recent WebKit sources. Can we close?
Mark Lam
(In reply to comment #1)
> I think this has been fixed in recent WebKit sources. Can we close?
I don't see any changes that could have made this warning go away. Has it stopped manifesting?