Closed
Bug 939464
Opened 11 years ago
Closed 11 years ago
warning: ‘*((void*)(& c)+16).js::CompartmentsInZoneIter::it’ may be used uninitialized in this function [-Wmaybe-uninitialized]
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla28
People
(Reporter: Benjamin, Assigned: Benjamin)
References
Details
(Whiteboard: [qa-])
Attachments
(1 file)
2.80 KB,
patch
|
billm
:
review+
|
Details | Diff | Splinter Review |
Every since 442211bce621 from bug 928050, GCC has been spewing crap like
In file included from ../jscompartment.h:13:0,
from /home/benjamin/dev/mozilla/inbound/js/src/gc/Iteration.cpp:7:
../gc/Zone.h: In function ‘void JS_IterateCompartments(JSRuntime*, void*, JSIterateCompartmentCallback)’:
../gc/Zone.h:421:9: warning: ‘*((void*)(& c)+16).js::CompartmentsInZoneIter::end’ may be used uninitialized in this function [-Wmaybe-uninitialized]
/home/benjamin/dev/mozilla/inbound/js/src/gc/Iteration.cpp:137:27: note: ‘*((void*)(& c)+16).js::CompartmentsInZoneIter::end’ was declared here
In file included from ../jscompartment.h:13:0,
from /home/benjamin/dev/mozilla/inbound/js/src/gc/Iteration.cpp:7:
../gc/Zone.h:380:13: warning: ‘*((void*)(& c)+16).js::CompartmentsInZoneIter::it’ may be used uninitialized in this function [-Wmaybe-uninitialized]
/home/benjamin/dev/mozilla/inbound/js/src/gc/Iteration.cpp:137:27: note: ‘*((void*)(& c)+16).js::CompartmentsInZoneIter::it’ was declared here
Here is a patch, which rewrites CompartmentsIterT to not use Maybe. It's not exactly pretty, since I have to introduce the concept of a empty CompartmentsInZoneIter.
Attachment #833374 -
Flags: review?(wmccloskey)
Comment on attachment 833374 [details] [diff] [review]
uiv-zone.patch
Review of attachment 833374 [details] [diff] [review]:
-----------------------------------------------------------------
Thanks. I suspect we could eliminate the placement new by keeping the friended nullptr constructor you added and calling it in the CompartmentsIterT constructor if zone.done() is true. Then we'd always be initializing and we could continue to use Maybe<T>.
However, it's up to you what to do. I'm not sure using Maybe<T> is any cleaner than directly doing placement new.
Attachment #833374 -
Flags: review?(wmccloskey) → review+
Assignee | ||
Comment 2•11 years ago
|
||
I retained the use of Maybe. It's still a bit awkward, especially Maybe now has to be friended.
https://hg.mozilla.org/integration/mozilla-inbound/rev/b4c82e9838d5
Assignee: nobody → benjamin
Assignee | ||
Comment 3•11 years ago
|
||
Now with less bugs:
https://hg.mozilla.org/integration/mozilla-inbound/rev/8a40011ec7cb
Comment 4•11 years ago
|
||
Status: NEW → RESOLVED
Closed: 11 years ago
Flags: in-testsuite-
Resolution: --- → FIXED
Target Milestone: --- → mozilla28
Comment on attachment 833374 [details] [diff] [review]
uiv-zone.patch
Review of attachment 833374 [details] [diff] [review]:
-----------------------------------------------------------------
Somehow bugzilla seems to have lost my previous review.
Attachment #833374 -
Flags: review?(wmccloskey) → review+
You need to log in
before you can comment on or make changes to this bug.
Description
•