diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2014-11-18 21:57:54 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2014-11-18 21:57:54 +0000 |
commit | 9699ab445ae007a5a6b32981da73baed77600671 (patch) | |
tree | 50d9e8000322e3bb7d74fbc7bfd11aea4bd51646 /lib/Sema/ScopeInfo.cpp | |
parent | ad6b92ee522bfad460be26ef29eb509e16902202 (diff) |
[Sema] Patch to issue warning on comparing parameters with
nonnull attribute when comparison is always true/false.
Original patch by Steven Wu. I have added extra code to prevent issuing of
warning when the nonnull parameter is modified prior to the comparison.
This addition prevents false positives in the most obvious cases.
There may still be false positive warnings in some cases (as one of my tests
indicates), but benefit far outweighs such cases. rdar://18712242
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@222264 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/ScopeInfo.cpp')
-rw-r--r-- | lib/Sema/ScopeInfo.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/Sema/ScopeInfo.cpp b/lib/Sema/ScopeInfo.cpp index c4bf67b76c..00d9982ac0 100644 --- a/lib/Sema/ScopeInfo.cpp +++ b/lib/Sema/ScopeInfo.cpp @@ -39,6 +39,7 @@ void FunctionScopeInfo::Clear() { ErrorTrap.reset(); PossiblyUnreachableDiags.clear(); WeakObjectUses.clear(); + ModifiedNonNullParams.clear(); } static const NamedDecl *getBestPropertyDecl(const ObjCPropertyRefExpr *PropE) { |