[PATCH] D159549: [analyzer] Fix false negative when accessing a nonnull property from a nullable object

2023-10-04 Thread tripleCC via Phabricator via cfe-commits
tripleCC added a comment. merged in https://github.com/llvm/llvm-project/pull/67563#event-10544755217 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D159549/new/ https://reviews.llvm.org/D159549 ___ cfe-co

[PATCH] D159549: [analyzer] Fix false negative when accessing a nonnull property from a nullable object

2023-09-27 Thread tripleCC via Phabricator via cfe-commits
tripleCC added a comment. In D159549#4651290 , @steakhal wrote: > For new revisions, prefer creating a PR at GitHub. ok, In D159549#4651290 , @steakhal wrote: > For new revisions, prefer creating a PR at GitHub

[PATCH] D159549: [analyzer] Fix false negative when accessing a nonnull property from a nullable object

2023-09-27 Thread tripleCC via Phabricator via cfe-commits
tripleCC added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/NullabilityChecker.cpp:903-904 if (!TrackedNullability && - getNullabilityAnnotation(ReturnType) == Nullability::Nullable) { + getNullabilityAnnotation(Call.getOriginExpr()->getType()) == +

[PATCH] D159549: [analyzer] Fix false negative when accessing a nonnull property from a nullable object

2023-09-27 Thread tripleCC via Phabricator via cfe-commits
tripleCC updated this revision to Diff 557405. tripleCC added a comment. adjust return type after checking getOriginExpr is non-null Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D159549/new/ https://reviews.llvm.org/D159549 Files: clang/lib/Stat

[PATCH] D159549: [analyzer] Fix false negative when accessing a nonnull property from a nullable object

2023-09-27 Thread tripleCC via Phabricator via cfe-commits
tripleCC created this revision. Herald added subscribers: steakhal, manas, ASDenysPetrov, martong, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, szepet, baloghadamsoftware, xazax.hun. Herald added a reviewer: NoQ. Herald added a project: All. tripleCC requested review of this revisio

[PATCH] D154221: [analyzer] Fix false negative when pass implicit cast nil to nonnull

2023-07-04 Thread tripleCC via Phabricator via cfe-commits
tripleCC added a comment. In D154221#4472112 , @steakhal wrote: > @tripleCC Could you clarify the status. Do you need some help or review? Do > you have concerns? > You made some inline comments that I couldn't put into context. @steakhal Yes, I need s

[PATCH] D154221: [analyzer] Fix false negative when pass implicit cast nil to nonnull

2023-07-04 Thread tripleCC via Phabricator via cfe-commits
tripleCC added inline comments. Comment at: clang/test/Analysis/nullability-arc.mm:25 [self foo:nil]; + // expected-warning@-1{{nil passed to a callee that requires a non-null 1st parameter}} I think there should be a warning when we call the foo: method

[PATCH] D154221: [analyzer] Fix false negative when pass implicit cast nil to nonnull

2023-07-04 Thread tripleCC via Phabricator via cfe-commits
tripleCC added inline comments. Comment at: clang/test/Analysis/nullability-arc.mm:26 [self foo:nil]; -#if __has_feature(objc_arc) - // expected-note@-2{{Calling 'foo:'}} - // expected-note@-3{{Passing nil object reference via 1st parameter 'param'}} -#endif + // expected-w

[PATCH] D154221: [analyzer] Fix false negative when pass implicit cast nil to nonnull

2023-07-04 Thread tripleCC via Phabricator via cfe-commits
tripleCC updated this revision to Diff 537110. tripleCC added a comment. try to fix nullability-arc.mm test case error Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D154221/new/ https://reviews.llvm.org/D154221 Files: clang/lib/StaticAnalyzer/Che

[PATCH] D153017: [analyzer] Fix false negative when using a nullable parameter directly without binding to a variable

2023-07-02 Thread tripleCC via Phabricator via cfe-commits
tripleCC added a comment. In D153017#4428432 , @steakhal wrote: > LGTM; I'll commit this on Monday. Oops, It seems that I missed the invitation, I just noticed the invitation email in my gmail now ... I will request Chris to send the invitation again. T

[PATCH] D153017: [analyzer] Fix false negative when using a nullable parameter directly without binding to a variable

2023-07-01 Thread tripleCC via Phabricator via cfe-commits
tripleCC marked an inline comment as done. tripleCC added a comment. In D153017#4428432 , @steakhal wrote: > LGTM; I'll commit this on Monday. Hi steakhal again, sorry to bother you. Do you mind committing the revision for me ? Repository: rG LLVM G

[PATCH] D154221: [analyzer] Fix false negative when pass implicit cast nil to nonnull

2023-07-01 Thread tripleCC via Phabricator via cfe-commits
tripleCC added a comment. I don't have commit access, would you mind committing the revision for me ? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D154221/new/ https://reviews.llvm.org/D154221 ___ cfe-co

[PATCH] D154221: Fix false negative when implicit cast nil to nonnull

2023-06-30 Thread tripleCC via Phabricator via cfe-commits
tripleCC created this revision. Herald added subscribers: steakhal, martong. Herald added a reviewer: NoQ. Herald added a project: All. tripleCC requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Repository: rG LLVM Github Monorepo https://

[PATCH] D153017: [analyzer] Fix false negative when using a nullable parameter directly without binding to a variable

2023-06-15 Thread tripleCC via Phabricator via cfe-commits
tripleCC added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/NullabilityChecker.cpp:569-594 +void NullabilityChecker::checkBeginFunction(CheckerContext &C) const { + const LocationContext *LCtx = C.getLocationContext(); + auto AbstractCall = AnyCall::forDecl(LC

[PATCH] D153017: [analyzer] Fix false negative when using a nullable parameter directly without binding to a variable

2023-06-15 Thread tripleCC via Phabricator via cfe-commits
tripleCC updated this revision to Diff 531784. tripleCC added a comment. Do not overwrite state Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D153017/new/ https://reviews.llvm.org/D153017 Files: clang/lib/StaticAnalyzer/Checkers/NullabilityChecke

[PATCH] D153017: [analyzer] Fix false negative when using a nullable parameter directly without binding to a variable

2023-06-15 Thread tripleCC via Phabricator via cfe-commits
tripleCC added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/NullabilityChecker.cpp:569-573 +void NullabilityChecker::checkBeginFunction(CheckerContext &C) const { + const LocationContext *LCtx = C.getLocationContext(); + auto AbstractCall = AnyCall::forDecl(LC

[PATCH] D153017: [analyzer] Fix false negative when using a nullable parameter directly without binding to a variable

2023-06-15 Thread tripleCC via Phabricator via cfe-commits
tripleCC updated this revision to Diff 531779. tripleCC added a comment. add inTopFrame condition. call the addTransition function only once for all params. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D153017/new/ https://reviews.llvm.org/D153017

[PATCH] D153017: [StaticAnalyzer] Fix false negative when using a nullable parameter directly without binding to a variable

2023-06-15 Thread tripleCC via Phabricator via cfe-commits
tripleCC created this revision. Herald added subscribers: steakhal, manas, ASDenysPetrov, martong, dkrupp, donat.nagy, Szelethus, a.sidorin, szepet, baloghadamsoftware. Herald added a reviewer: NoQ. Herald added a project: All. tripleCC requested review of this revision. Herald added a project: cl

[PATCH] D152269: [StaticAnalyzer] Fix false negative on NilArgChecker when creating literal object

2023-06-08 Thread tripleCC via Phabricator via cfe-commits
tripleCC updated this revision to Diff 529584. tripleCC added a comment. clang-format BasicObjCFoundationChecks Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D152269/new/ https://reviews.llvm.org/D152269 Files: clang/lib/StaticAnalyzer/Checkers/B

[PATCH] D152269: [StaticAnalyzer] Fix false negative on NilArgChecker when creating literal object

2023-06-08 Thread tripleCC via Phabricator via cfe-commits
tripleCC updated this revision to Diff 529583. tripleCC added a comment. taking steakhal's advice Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D152269/new/ https://reviews.llvm.org/D152269 Files: clang/lib/StaticAnalyzer/Checkers/BasicObjCFounda

[PATCH] D152269: [StaticAnalyzer] Fix false negative on NilArgChecker when creating literal object

2023-06-07 Thread tripleCC via Phabricator via cfe-commits
tripleCC added a comment. In D152269#4403404 , @steakhal wrote: > In D152269#4403282 , @tripleCC > wrote: > >> Yes, your changes are aligned with my intent. It seems like you have made >> excellent optimizations

[PATCH] D152269: [StaticAnalyzer] Fix false negative on NilArgChecker when creating literal object

2023-06-07 Thread tripleCC via Phabricator via cfe-commits
tripleCC added a comment. In D152269#4402593 , @steakhal wrote: > I had some improvement opportunities in mind scattered, so I decided to do > them, and here is how the diff looks for me now: F27853795: > recommendation.patch

[PATCH] D152269: [StaticAnalyzer] Fix false negative on NilArgChecker when creating literal object

2023-06-06 Thread tripleCC via Phabricator via cfe-commits
tripleCC added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp:151-164 + auto ArgSVal = C.getSVal(E).getAs(); + if (!ArgSVal) +return; + + ProgramStateRef StNonNull, StNull; + std::tie(StNonNull, StNull) = State->assume(*ArgSV

[PATCH] D152269: [StaticAnalyzer] Fix false negative on NilArgChecker when creating literal object

2023-06-06 Thread tripleCC via Phabricator via cfe-commits
tripleCC added inline comments. Comment at: clang/test/Analysis/NSContainers.m:336-337 +void testCreateArrayLiteralWithNullableArg() { + (void)@[getNonnullFoo()]; // no warning + (void)@[getNullableFoo()]; // expected-warning {{Nullable pointer is passed to a callee that requi

[PATCH] D152269: [StaticAnalyzer] Fix false negative on NilArgChecker when creating literal object

2023-06-06 Thread tripleCC via Phabricator via cfe-commits
tripleCC updated this revision to Diff 529116. tripleCC added a comment. [StaticAnalyzer] add might be null test case for NilArgChecker Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D152269/new/ https://reviews.llvm.org/D152269 Files: clang/lib/S

[PATCH] D152269: [StaticAnalyzer] Fix false negtive on NilArgChecker when creating literal object

2023-06-06 Thread tripleCC via Phabricator via cfe-commits
tripleCC created this revision. Herald added subscribers: steakhal, manas, ASDenysPetrov, martong, dkrupp, donat.nagy, Szelethus, a.sidorin, szepet, baloghadamsoftware. Herald added a reviewer: NoQ. Herald added a project: All. tripleCC requested review of this revision. Herald added a project: cl

[PATCH] D151651: [StaticAnalyzer] Fix block pointer type nullability check

2023-05-29 Thread tripleCC via Phabricator via cfe-commits
tripleCC added a comment. In D151651#4379144 , @steakhal wrote: > Looks good. > That pesky ObjC :D I don't have commit access, could you help me to commit it? thanks --author "tripleCC " Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D151651: [StaticAnalyzer] Fix block pointer type nullability check

2023-05-29 Thread tripleCC via Phabricator via cfe-commits
tripleCC created this revision. Herald added subscribers: steakhal, manas, ASDenysPetrov, martong, dkrupp, donat.nagy, Szelethus, a.sidorin, szepet, baloghadamsoftware. Herald added a reviewer: NoQ. Herald added a project: All. tripleCC requested review of this revision. Herald added a project: cl