Closed Bug 863891 Opened 12 years ago Closed 12 years ago

Warnings in branchTruncateDouble code, comparing signed-unsigned values

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla23

People

(Reporter: Waldo, Assigned: Waldo)

References

Details

Attachments

(1 file)

INT64_MIN == 0x8000000000000000 compares a signed value (left) to an unsigned value (right), because the right side's number doesn't fit in int64_t. Smacking an LL at the end doesn't help, because 0x8...0 doesn't fit in int64_t. Unary minus isn't a part of a numeric literal, so -0x8....0LL is the negation of an unsigned, which is unsigned. As the Intel manuals don't talk about the negative-most integer but rather about an "indefinite integer value" that happens to also be the most negative one, it seems like the best workaround is to eschew INT*_MIN entirely here, and just to write out the hex constants manually. This patch does that (both x86 and x86-64, for consistency).
Blocks: 863349
Attachment #739837 - Flags: review?(jdemooij) → review+
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: