This revision was automatically updated to reflect the committed changes.
Closed by commit rL285533: [analyzer] NumberObjectConversion: support more
types, misc updates. (authored by dergachev).
Changed prior to commit:
https://reviews.llvm.org/D25731?vs=76043&id=76349#toc
Repository:
rL LLV
dcoughlin accepted this revision.
dcoughlin added a comment.
LGTM.
Comment at: test/Analysis/number-object-conversion.m:98
+
+#define NULL_INSIDE_MACRO NULL
+void test_NULL_inside_macro(NSNumber *p) {
This is great! And a good catch.
https://reviews.llvm.org/
NoQ updated this revision to Diff 76043.
NoQ added a comment.
- Fix warning messages, finally, hopefully.
- Make handling of macros much more careful, because errors of form `x == Y`,
where X is an `NSNumber` pointer, and `Y` is a custom macro that expands to
`0`, were found.
https://reviews.l
zaks.anna accepted this revision.
zaks.anna added a comment.
This revision is now accepted and ready to land.
Minor nit below.
Thanks for iterating so much on this!
Anna.
Comment at: test/Analysis/number-object-conversion.cpp:46
+#ifdef PEDANTIC
+ if (p) {} // expected-warnin
NoQ updated this revision to Diff 75612.
NoQ added a comment.
Do not suggest any API when we're not sure (was already advised by Anna but i
missed it somehow).
https://reviews.llvm.org/D25731
Files:
lib/StaticAnalyzer/Checkers/NumberObjectConversionChecker.cpp
test/Analysis/number-object-c
NoQ updated this revision to Diff 75586.
NoQ marked an inline comment as done.
NoQ added a comment.
- Update warning messages. I think it's better to pattern-match for integer
sizes after all when we're suggesting API, this especially looks ugly for
OSNumber (which is rare).
- Add tests for conv
zaks.anna added inline comments.
Comment at: test/Analysis/number-object-conversion.c:14
+ if (p) {} // expected-warning{{Converting 'CFNumberRef' to a plain boolean
value for branching; please compare the pointer to NULL instead to suppress
this warning}}
+ if (!p) {} // exp
NoQ marked an inline comment as done.
NoQ added inline comments.
Comment at: lib/StaticAnalyzer/Checkers/NumberObjectConversionChecker.cpp:149
BugReporter &BR) const {
MatchFinder F;
Callback CB(this, BR, AM.getAnalysisD
NoQ updated this revision to Diff 75411.
NoQ marked 5 inline comments as done.
NoQ added a comment.
Address review comments. Add the forgotten tests.
https://reviews.llvm.org/D25731
Files:
lib/StaticAnalyzer/Checkers/NumberObjectConversionChecker.cpp
test/Analysis/number-object-conversion.c
zaks.anna added inline comments.
Comment at: lib/StaticAnalyzer/Checkers/NumberObjectConversionChecker.cpp:111
+ QualType ObjT = (IsCpp || IsObjC)
+ ? Obj->getType().getCanonicalType().getUnqualifiedType()
+ : Obj->getType();
---
alexshap added inline comments.
Comment at: lib/StaticAnalyzer/Checkers/NumberObjectConversionChecker.cpp:149
BugReporter &BR) const {
MatchFinder F;
Callback CB(this, BR, AM.getAnalysisDeclContext(D));
NoQ added a comment.
Ouch, i think i forgot about `OSNumber`, including tests.
Comment at: lib/StaticAnalyzer/Checkers/NumberObjectConversionChecker.cpp:111
+ QualType ObjT = (IsCpp || IsObjC)
+ ? Obj->getType().getCanonicalType().getUnqualifiedType()
+
12 matches
Mail list logo