This revision was automatically updated to reflect the committed changes.
Closed by commit rL285605: [analyzer] MacOSXAPIChecker: Disallow
dispatch_once_t in ivars and heap. (authored by dergachev).
Changed prior to commit:
https://reviews.llvm.org/D25909?vs=75998=76446#toc
Repository:
rL
zaks.anna accepted this revision.
zaks.anna added a comment.
This revision is now accepted and ready to land.
Looks great! Please, commit.
https://reviews.llvm.org/D25909
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
NoQ added inline comments.
Comment at: test/Analysis/dispatch-once.m:62
+- (void)test_ivar_struct_from_inside {
+ dispatch_once(, ^{}); // expected-warning{{Call to 'dispatch_once'
uses the instance variable 's' for the predicate value.}}
+}
dcoughlin wrote:
>
NoQ updated this revision to Diff 75998.
NoQ marked 3 inline comments as done.
NoQ added a comment.
Also, do not create error nodes unless we're sure we're throwing a report.
https://reviews.llvm.org/D25909
Files:
lib/StaticAnalyzer/Checkers/MacOSXAPIChecker.cpp
dcoughlin added inline comments.
Comment at: lib/StaticAnalyzer/Checkers/MacOSXAPIChecker.cpp:94
+ else if (isa(RS)) {
+// FIXME: Presence of an IVar region has priority over this branch, because
+// ObjC objects are on the heap even if the core doesn't realize this.
NoQ updated this revision to Diff 75739.
NoQ marked 2 inline comments as done.
NoQ added a comment.
Consider a lot more dispatch_once_t regions: improve diagnostics for local
structs containing predicates, find ivar structs with predicates.
Address a couple of review comments, discuss the rest.
NoQ added inline comments.
Comment at: test/Analysis/dispatch-once.m:13
+
+void test_stack() {
+ dispatch_once_t once;
dcoughlin wrote:
> Should the tests for dispatch_once in unix-fns.c be moved here?
In fact we need to de-duplicate code with unix.API's
zaks.anna added a comment.
Looks good overall!
https://reviews.llvm.org/D25909
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
NoQ added inline comments.
Comment at: lib/StaticAnalyzer/Checkers/MacOSXAPIChecker.cpp:94
+ else if (isa(RS)) {
+// FIXME: Presence of an IVar region has priority over this branch, because
+// ObjC objects are on the heap even if the core doesn't realize this.
dcoughlin added inline comments.
Comment at: lib/StaticAnalyzer/Checkers/MacOSXAPIChecker.cpp:92
+ else if (isa(RS))
+os << " heap allocated memory";
+ else if (isa(RS)) {
"heap allocated" --> "heap-allocated"
Comment at:
NoQ updated this revision to Diff 75589.
NoQ added a comment.
Hotfix code duplication i just noticed.
https://reviews.llvm.org/D25909
Files:
lib/StaticAnalyzer/Checkers/MacOSXAPIChecker.cpp
test/Analysis/dispatch-once.m
Index: test/Analysis/dispatch-once.m
NoQ created this revision.
NoQ added reviewers: zaks.anna, dcoughlin.
NoQ added a subscriber: cfe-commits.
As documentation in
https://developer.apple.com/reference/dispatch/dispatch_once_t says, only
global or static variables should have type `dispatch_once_t`, otherwise the
magic with fast
12 matches
Mail list logo