GCC integer overflow warnings in jsatominlines.h

RESOLVED FIXED in mozilla15

Status

()

Core
JavaScript Engine
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: njn, Assigned: bhackett)

Tracking

unspecified
mozilla15
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

5 years ago
Created attachment 621473 [details] [diff] [review]
patch

I'm getting millions of these from GCC:

../jsatominlines.h: In function ‘bool js::IndexToId(JSContext*, uint32_t, jsid*)’:
../jsatominlines.h:136:18: warning: integer overflow in expression [-Woverflow]
../jsatominlines.h: In function ‘jsid js::AtomToId(JSAtom*)’:
../jsatominlines.h:151:43: warning: integer overflow in expression [-Woverflow]

But 751331 seems to be the cause.

bhackett, the attached patch fixes the warnings, but I don't know if it's the right fix.
Attachment #621473 - Flags: feedback?(bhackett1024)
(Assignee)

Comment 1

5 years ago
Comment on attachment 621473 [details] [diff] [review]
patch

I think that INT32_MAX would be the best fix (didn't get these warnings with my GCC).
Attachment #621473 - Flags: feedback?(bhackett1024)
(Assignee)

Comment 2

5 years ago
Oh, r+ if you want to check in the INT32_MAX fix.  Thanks!
(Reporter)

Comment 3

5 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/773d2422d0b7
https://hg.mozilla.org/mozilla-central/rev/773d2422d0b7
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla15
You need to log in before you can comment on or make changes to this bug.