Last Comment Bug 752374 - GCC integer overflow warnings in jsatominlines.h
: GCC integer overflow warnings in jsatominlines.h
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: JavaScript Engine (show other bugs)
: unspecified
: All All
: -- normal (vote)
: mozilla15
Assigned To: Brian Hackett (:bhackett)
:
Mentors:
Depends on:
Blocks: 751331
  Show dependency treegraph
 
Reported: 2012-05-06 16:28 PDT by Nicholas Nethercote [:njn] (on vacation until July 11)
Modified: 2012-05-07 16:10 PDT (History)
2 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
patch (497 bytes, patch)
2012-05-06 16:28 PDT, Nicholas Nethercote [:njn] (on vacation until July 11)
no flags Details | Diff | Review

Description Nicholas Nethercote [:njn] (on vacation until July 11) 2012-05-06 16:28:59 PDT
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.
Comment 1 Brian Hackett (:bhackett) 2012-05-06 16:33:42 PDT
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).
Comment 2 Brian Hackett (:bhackett) 2012-05-06 16:34:07 PDT
Oh, r+ if you want to check in the INT32_MAX fix.  Thanks!
Comment 3 Nicholas Nethercote [:njn] (on vacation until July 11) 2012-05-06 16:59:20 PDT
https://hg.mozilla.org/integration/mozilla-inbound/rev/773d2422d0b7
Comment 4 :Ehsan Akhgari (out sick) 2012-05-07 16:10:22 PDT
https://hg.mozilla.org/mozilla-central/rev/773d2422d0b7

Note You need to log in before you can comment on or make changes to this bug.