Closed
Bug 573786
Opened 14 years ago
Closed 14 years ago
Script to detect static initializers
Categories
(Developer Infrastructure :: Source Code Analysis, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: taras.mozilla, Assigned: ehren.m)
References
Details
Attachments
(2 files, 3 obsolete files)
(deleted),
text/plain
|
Details | |
(deleted),
patch
|
ehren.m
:
review+
|
Details | Diff | Splinter Review |
Need a *hydra script to detect these. I think it's a matter of looking for generated functions that are destined for .ctors section.
Assignee | ||
Comment 1•14 years ago
|
||
It's a bit messy to hardcode the name __static_initialization_and_destruction but this is what's done by gcc.
Attachment #453309 -
Flags: review?(tglek)
Assignee | ||
Comment 2•14 years ago
|
||
note that the calls to __cxa_atexit are to ensure that the destructor for a statically initialized object is called on library unload/exit.
Reporter | ||
Comment 3•14 years ago
|
||
(In reply to comment #2) > Created an attachment (id=453310) [details] > results > > note that the calls to __cxa_atexit are to ensure that the destructor for a > statically initialized object is called on library unload/exit. Yeah, those are often harmful too. https://bugzilla.mozilla.org/show_bug.cgi?id=569629#c11 Very nice. You even found a few nsCOMPtr globals. Excellent work!
Reporter | ||
Comment 4•14 years ago
|
||
Comment on attachment 453309 [details] [diff] [review] script >+ warning(pretty_var(arg) + " defined by call to constructor " + pretty_func(decl) + >+ warning(pretty_func(decl) + " called during static initialization", location_of(decl)); Nice detailed error messages. This is even better than I expected.
Attachment #453309 -
Flags: review?(tglek) → review+
Assignee | ||
Comment 5•14 years ago
|
||
changing to use cfg_isn_iterator, carrying over r+.
Attachment #453309 -
Attachment is obsolete: true
Attachment #454657 -
Flags: review+
Assignee | ||
Updated•14 years ago
|
Keywords: checkin-needed
Assignee | ||
Comment 6•14 years ago
|
||
missed a testcase, carrying over r+
Attachment #454657 -
Attachment is obsolete: true
Attachment #455524 -
Flags: review+
Assignee | ||
Comment 7•14 years ago
|
||
added commit message to patch
Attachment #455524 -
Attachment is obsolete: true
Attachment #466456 -
Flags: review+
Comment 8•14 years ago
|
||
Comment on attachment 466456 [details] [diff] [review] patch http://hg.mozilla.org/mozilla-central/rev/b240b82abfaf
Updated•14 years ago
|
Updated•7 years ago
|
Product: Core → Firefox Build System
Updated•2 years ago
|
Product: Firefox Build System → Developer Infrastructure
You need to log in
before you can comment on or make changes to this bug.
Description
•