Closed Bug 573786 Opened 10 years ago Closed 10 years ago
Script to detect static initializers
Need a *hydra script to detect these. I think it's a matter of looking for generated functions that are destined for .ctors section.
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)
note that the calls to __cxa_atexit are to ensure that the destructor for a statically initialized object is called on library unload/exit.
(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!
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+
changing to use cfg_isn_iterator, carrying over r+.
missed a testcase, carrying over r+
added commit message to patch
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.