Closed Bug 773014 Opened 8 years ago Closed 5 years ago

Add static analysis assertion that Static{Auto,Ref}Ptr is used only in global scope

Categories

(Firefox Build System :: Source Code Analysis, defect)

defect
Not set

Tracking

(Not tracked)

RESOLVED FIXED
mozilla37

People

(Reporter: justin.lebar+bug, Assigned: ehsan)

References

Details

Attachments

(2 files, 3 obsolete files)

See bug 772987 -- Static{Auto,Ref}Ptr should be used only in global scope (where its mRawPtr is automatically initialized to 0).  Ehsan suggests enforcing this via static analysis.
Assignee: nobody → ehsan
Attachment #8536096 - Flags: review?(jmuizelaar)
Attachment #8536097 - Flags: review?(jmuizelaar)
Attachment #8536096 - Attachment is obsolete: true
Attachment #8536096 - Flags: review?(jmuizelaar)
Attachment #8536098 - Flags: review?(jmuizelaar)
Comment on attachment 8536098 [details] [diff] [review]
Part 1: Add an analysis for marking classes as global-only

Review of attachment 8536098 [details] [diff] [review]:
-----------------------------------------------------------------

::: build/clang-plugin/clang-plugin.cpp
@@ +38,5 @@
>      return astMatcher.newASTConsumer();
>    }
>  
>  private:
> +  class LocalGlobalClassChecker : public MatchFinder::MatchCallback {

LocalGlobal is a poor name. ScopeClassChecker would be better or even maybe just ScopeChecker.
Attachment #8536098 - Flags: review?(jmuizelaar) → review+
Note to self: jrmuizel voted for MOZ_ONLY_USED_TO_AVOID_STATIC_CONSTRUCTORS.
Attachment #8536098 - Attachment is obsolete: true
Attachment #8536097 - Attachment is obsolete: true
Attachment #8536097 - Flags: review?(jmuizelaar)
Attachment #8539748 - Flags: review?(jmuizelaar)
Blocks: 1114267
Attachment #8539747 - Flags: review?(jmuizelaar) → review+
Attachment #8539748 - Flags: review?(jmuizelaar) → review+
https://hg.mozilla.org/mozilla-central/rev/baf97266ac9b
https://hg.mozilla.org/mozilla-central/rev/6b3f00c078b1
Status: NEW → RESOLVED
Closed: 5 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla37
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.