Re: r244416 - [modules] PR22534: Load files specified by -fmodule-file= eagerly. In particular, this avoids the need to re-parse module map files when using such a module.

2015-08-18 Thread Gábor Horváth via cfe-commits
Sorry, I sent the original message to the wrong list. -- Forwarded message -- From: Gábor Horváth xazax@gmail.com Date: 18 August 2015 at 12:59 Subject: Re: r244416 - [modules] PR22534: Load files specified by -fmodule-file= eagerly. In particular, this avoids the need to

Re: [PATCH] D11468: [Static Analyzer] The first implementation of nullability checker.

2015-08-24 Thread Gábor Horváth via cfe-commits
xazax.hun marked 11 inline comments as done. xazax.hun added a comment. Thank you for the review. I will upload the new version of the patch once the rest of it was reviewed. Comment at: lib/StaticAnalyzer/Checkers/NullabilityChecker.cpp:12 @@ +11,3 @@ +// checker is that, the

Re: [PATCH] D12123: [analyzer] Skip Pre/Post handlers for ObjC calls when receiver is nil.

2015-08-20 Thread Gábor Horváth via cfe-commits
xazax.hun added inline comments. Comment at: lib/StaticAnalyzer/Core/CheckerManager.cpp:237 @@ +236,3 @@ +return PreObjCMessageCheckers; +break; + case ObjCMessageVisitKind::Post: nit: remove the break after the return. Comment at:

Re: [PATCH] D11433: [Static Analyzer] Make NonNullParamChecker emit implicit null dereference events.

2015-08-17 Thread Gábor Horváth via cfe-commits
xazax.hun added a comment. The problem here is that, this checker can emit a warning for two cases: 1, Null was bound to a reference which should be reported as a dereference 2, Null was passed to parameter that should be non-null (marked by the attribute, not the qualifier) which should be

Re: [PATCH] D11427: [Static Analyzer] Checker for Obj-C generics

2015-08-14 Thread Gábor Horváth via cfe-commits
xazax.hun added a comment. Addressed the suggestions. Comment at: lib/StaticAnalyzer/Checkers/ObjCGenericsChecker.cpp:257 @@ +256,3 @@ +// However a downcast may also lose information. E. g.: +// MutableMapT, U : Map +// The downcast to mutable map loses the

Re: [PATCH] D12123: [analyzer] Skip Pre/Post handlers for ObjC calls when receiver is nil.

2015-08-25 Thread Gábor Horváth via cfe-commits
xazax.hun accepted this revision. xazax.hun added a comment. This revision is now accepted and ready to land. Looks good to me. http://reviews.llvm.org/D12123 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

Re: [PATCH] D10305: [Clang Static Analyzer] Bug identification

2015-10-22 Thread Gábor Horváth via cfe-commits
xazax.hun added a comment. In http://reviews.llvm.org/D10305#272013, @honggyu.kim wrote: > Hi Gabor, > > I was away from the office for 3 weeks so I couldn't catch up the issues but > you almost completed the patch now. > Thanks for this work! > > I just found a tiny problem and described it

Re: [PATCH] D10305: [Clang Static Analyzer] Bug identification

2015-10-22 Thread Gábor Horváth via cfe-commits
xazax.hun closed this revision. xazax.hun added a comment. Committed in r251011. http://reviews.llvm.org/D10305 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D14096: [clang-tidy] add new check cppcoreguidelines-pro-type-cstyle-cast

2015-10-27 Thread Gábor Horváth via cfe-commits
xazax.hun added a subscriber: xazax.hun. xazax.hun added a comment. There is already a similar check in the Google package. What are the differences between those two checks? What is the reason we can not just register that check into the core guidelines module? http://reviews.llvm.org/D14096

Re: r251289 - [analyzer] Fixed a rare crash when analyzing lambda functions.

2015-10-26 Thread Gábor Horváth via cfe-commits
Added missing testcase in r251313. On 26 October 2015 at 17:45, David Blaikie wrote: > > > On Mon, Oct 26, 2015 at 6:32 AM, Gabor Horvath via cfe-commits < > cfe-commits@lists.llvm.org> wrote: > >> Author: xazax >> Date: Mon Oct 26 08:32:26 2015 >> New Revision: 251289 >> >>

Re: r251289 - [analyzer] Fixed a rare crash when analyzing lambda functions.

2015-10-26 Thread Gábor Horváth via cfe-commits
On 26 October 2015 at 17:45, David Blaikie wrote: > > > On Mon, Oct 26, 2015 at 6:32 AM, Gabor Horvath via cfe-commits < > cfe-commits@lists.llvm.org> wrote: > >> Author: xazax >> Date: Mon Oct 26 08:32:26 2015 >> New Revision: 251289 >> >> URL:

Re: [PATCH] D12906: [RFC] Bug identification("issue_hash") change for CmpRuns.py

2015-10-22 Thread Gábor Horváth via cfe-commits
xazax.hun added a comment. In http://reviews.llvm.org/D12906#273088, @honggyu.kim wrote: > In http://reviews.llvm.org/D12906#272257, @dkrupp wrote: > > > Hi Anna & Kim, > > > Hi Daniel, > > > we recognized these scalability issues you just described and that's why we > > created CodeChecker

Re: [PATCH] D14203: [analyzer] Improve pointer arithmetic checker.

2015-11-12 Thread Gábor Horváth via cfe-commits
xazax.hun added inline comments. Comment at: lib/StaticAnalyzer/Checkers/PointerArithChecker.cpp:28 @@ -24,1 +27,3 @@ namespace { +enum class AllocKind { + SingletonNew, dcoughlin wrote: > Is it necessary to distinguish so many cases here? For example, why do

Re: [PATCH] D10305: [Clang Static Analyzer] Bug identification

2015-11-10 Thread Gábor Horváth via cfe-commits
xazax.hun added a comment. Thank you for pointing this out. I think it would be great to be forward compatible. Right now one could use a heuristic such as for every hash the key has the "hash" string in its name. This information might not be sufficient, however, since it would be great to

[PATCH] D14203: [analyzer] Improve pointer arithmetic checker.

2015-10-30 Thread Gábor Horváth via cfe-commits
xazax.hun created this revision. xazax.hun added reviewers: zaks.anna, dcoughlin. xazax.hun added subscribers: cfe-commits, dkrupp. This patch is intended to improve pointer arithmetic checker. >From now on it tries to only warn, when the pointer arithmetic is likely to >cause an error. For

Re: [PATCH] D14345: [analyzer] Update SATestBuild.py to enable a 'download and patch' model for projects.

2015-11-04 Thread Gábor Horváth via cfe-commits
xazax.hun added a comment. Hi! I think it is great to support this model in these scripts. Do you plan to check the list of the project urls in to the repository as well? I think it would be great to do so, so one can easily reproduce a buildbot error locally, or even run the whole testsuit.

Re: [PATCH] D9556: [clang-tidy] Support for Static Analyzer plugins (clang part)

2015-11-05 Thread Gábor Horváth via cfe-commits
xazax.hun added a comment. Unfortunately I had no time to work on this patch, and after I did not finish this the team I was working in took a different approach: running static analyzer checker through clang and tidy checkers through clang tidy. Initially we wanted to avoid this approach,

Re: [PATCH] D13731: [RFC][Analyzer] Supporting function attributes in .model files.

2015-10-15 Thread Gábor Horváth via cfe-commits
xazax.hun added reviewers: krememek, zaks.anna, dcoughlin. xazax.hun added a comment. Hi! I have some high level questions and notes about this patch. I implemented the function modelling as a Google Summer of Code project and Ted Kremenek was my mentor. I am happy that you found an useful

Re: [PATCH] D10305: [Clang Static Analyzer] Bug identification

2015-10-08 Thread Gábor Horváth via cfe-commits
xazax.hun added a comment. Thank you for the review! Before committing this I would like to have a policy regarding future changes and document it inside the IssueHash header. My proposed policy is the following: - Do not change the calculation of issue hash unless we have a very good reason

Re: [PATCH] D13099: [Analyzer] Don’t invalidate CXXThis when conservatively evaluating const methods (PR 21606)

2015-10-08 Thread Gábor Horváth via cfe-commits
xazax.hun added a comment. In http://reviews.llvm.org/D13099#260531, @seaneveson wrote: > There is an issue where pointers to the object (this) should cause it to be > invalidated, but don't since TK_PreserveContents has been set. > > For example: > > class B; > class A { > B b; >

Re: [PATCH] D10305: [Clang Static Analyzer] Bug identification

2015-10-16 Thread Gábor Horváth via cfe-commits
xazax.hun added a comment. In http://reviews.llvm.org/D10305#268777, @phillip.power wrote: > In http://reviews.llvm.org/D10305#262534, @xazax.hun wrote: > > > - Should we require the generation of old hashes once a change is > > introduced, or should we expect users who rely on old hash to

Re: [PATCH] D10305: [Clang Static Analyzer] Bug identification

2015-10-06 Thread Gábor Horváth via cfe-commits
xazax.hun marked 2 inline comments as done. xazax.hun added a comment. In http://reviews.llvm.org/D10305#258671, @zaks.anna wrote: > > Generating mangled names requires ASTContext which is not available during > > the error reporting. BugReporter does have the ASTContext, so it would not > > >

Re: [PATCH] D13099: [Analyzer] Don’t invalidate CXXThis when conservatively evaluating const methods (PR 21606)

2015-10-06 Thread Gábor Horváth via cfe-commits
xazax.hun added inline comments. Comment at: test/Analysis/const-method-call.cpp:26 @@ +25,3 @@ + +struct Derived : Base { + mutable int mut; Please add a test case, where only base have a mutable field. http://reviews.llvm.org/D13099

Re: [PATCH] D14736: [analyzer] DeadStoresChecker: Treat locals captured by reference in C++ lambdas as escaped.

2015-11-17 Thread Gábor Horváth via cfe-commits
xazax.hun added a comment. This looks good to me, I have one question inline. Comment at: lib/StaticAnalyzer/Checkers/DeadStoresChecker.cpp:425 @@ +424,3 @@ +llvm::DenseMap CaptureFields; +FieldDecl *ThisCaptureField; +LambdaClass->getCaptureFields(CaptureFields,

Re: [PATCH] D14170: Fix false positive warning about memory leak for QApplication::postEvent

2015-11-17 Thread Gábor Horváth via cfe-commits
xazax.hun added inline comments. Comment at: lib/StaticAnalyzer/Checkers/MallocChecker.cpp:2514 @@ -2513,1 +2513,3 @@ + if (FName.endswith("postEvent") && + FD->getQualifiedNameAsString() == "QCoreApplication::postEvent") { Shouldn't you use == instead of

Re: [PATCH] D11433: [Static Analyzer] Make NonNullParamChecker emit implicit null dereference events.

2015-08-27 Thread Gábor Horváth via cfe-commits
xazax.hun updated this revision to Diff 5. xazax.hun added a comment. - Updated to latest trunk. - Added a new field to the event with documentation. - Rebased the patch on the top of nullability checker. - Added covered cases to the nullability checker tests. http://reviews.llvm.org/D11433

Re: [PATCH] D12163: [Patch] [Analyzer] BugReporter.cpp:2869: Assertion failed: !RemainingNodes.empty() No error node found in the trimmed graph (PR 24184)

2015-08-27 Thread Gábor Horváth via cfe-commits
xazax.hun added a subscriber: xazax.hun. xazax.hun closed this revision. xazax.hun added a comment. Committed in http://reviews.llvm.org/rL246188. Thanks for the patch. http://reviews.llvm.org/D12163 ___ cfe-commits mailing list

[PATCH] D12381: [Static Analyzer] Merge the Objective-C Generics Checker into Dynamic Type Propagation checker.

2015-08-26 Thread Gábor Horváth via cfe-commits
xazax.hun created this revision. xazax.hun added reviewers: krememek, zaks.anna, jordan_rose, dcoughlin. xazax.hun added a subscriber: cfe-commits. This patch merged the functionality from ObjCGenericsChecker into DynamicTypePropagation checker. Note that the Generics Checker can still be turned

Re: [PATCH] D11468: [Static Analyzer] The first implementation of nullability checker.

2015-08-26 Thread Gábor Horváth via cfe-commits
xazax.hun updated this revision to Diff 33239. xazax.hun added a comment. - Fine tuned the heuristics for cocoa APIs. - Only track nullable and contradicted nullability for symbols. Use the rest statically. - Cleanups. http://reviews.llvm.org/D11468 Files: docs/analyzer/nullability.rst

Re: [PATCH] D12358: [Analyzer] Handling constant bound loops

2015-08-26 Thread Gábor Horváth via cfe-commits
xazax.hun added a comment. A conservative solution should work. But if we want to preserve some precision I think it should be possible to not to invalidate those values on the stack that are not effected by the loop. The hard problem here is that, it is impossible to reason about the heap

Re: [PATCH] D11832: [Patch] [Analyzer] false positive: Potential leak connected with memcpy (PR 22954)

2015-08-31 Thread Gábor Horváth via cfe-commits
xazax.hun added a comment. Hi! With this patch committed I noticed a regression in the static analyzer. I analyzed openssl-1.0.0d (using the test suite in utils/analyzer/SATestBuild.py). I got the following assertion error: (lldb) bt - thread #1: tid = 0xa1fcb, 0x7fff943e50ae

Re: [PATCH] D11832: [Patch] [Analyzer] false positive: Potential leak connected with memcpy (PR 22954)

2015-08-31 Thread Gábor Horváth via cfe-commits
xazax.hun added a comment. I reverted the commit until this assertion is fixed. Steps to reproduce: Download the following preprocessed file: F804743: clang_crash_7QnDaH.i Execute the analyzer on that one: clang -cc1 -analyze -analyzer-checker=core

Re: [PATCH] D12381: [Static Analyzer] Merge the Objective-C Generics Checker into Dynamic Type Propagation checker.

2015-09-01 Thread Gábor Horváth via cfe-commits
xazax.hun marked an inline comment as not done. Comment at: lib/StaticAnalyzer/Checkers/DynamicTypePropagation.cpp:81 @@ +80,3 @@ +initBugType(); +SmallString<64> Buf; +llvm::raw_svector_ostream OS(Buf); zaks.anna wrote: > How do we know that the

Re: [PATCH] D12445: [Static Analyzer] Remove sinks from nullability checks.

2015-09-01 Thread Gábor Horváth via cfe-commits
xazax.hun added inline comments. Comment at: lib/StaticAnalyzer/Checkers/NullabilityChecker.cpp:806 @@ -690,1 +805,3 @@ + ProgramStateRef State = C.getState(); + if (State->get()) zaks.anna wrote: > Maybe we should only check these at the time the bug is

Re: [PATCH] D12445: [Static Analyzer] Remove sinks from nullability checks.

2015-09-01 Thread Gábor Horváth via cfe-commits
xazax.hun updated this revision to Diff 33728. xazax.hun marked 2 inline comments as done. xazax.hun added a comment. Style fixes according to the review. http://reviews.llvm.org/D12445 Files: lib/StaticAnalyzer/Checkers/NullabilityChecker.cpp test/Analysis/nullability.mm Index:

Re: [PATCH] D12381: [Static Analyzer] Merge the Objective-C Generics Checker into Dynamic Type Propagation checker.

2015-09-08 Thread Gábor Horváth via cfe-commits
xazax.hun marked 2 inline comments as done. xazax.hun added a comment. There are several fallouts from this review, so I decided to split this patch up the following way: 1. I created a patch to incorporate the result of this review into ObjCGenericsChecker: http://reviews.llvm.org/D12701 2. I

Re: [PATCH] D12701: [Static Analyzer] Objective-C Generics checker improvements.

2015-09-08 Thread Gábor Horváth via cfe-commits
xazax.hun marked 2 inline comments as done. xazax.hun added a comment. http://reviews.llvm.org/D12701 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D12652: [Static Analyzer] Lambda support.

2015-09-08 Thread Gábor Horváth via cfe-commits
xazax.hun updated this revision to Diff 34285. xazax.hun added a comment. - Updated to newest trunk. - Moved the feature behind an option. - Fixed a crash when an operator() of a lambda is analyzed as a top level function, and a ThisExpr is referring to the this in the enclosing scope (this can

Re: [PATCH] D12445: [Static Analyzer] Remove sinks from nullability checks.

2015-09-01 Thread Gábor Horváth via cfe-commits
xazax.hun updated this revision to Diff 33704. xazax.hun added a comment. Made sure that inlined defensive checks do not generate false positives. http://reviews.llvm.org/D12445 Files: lib/StaticAnalyzer/Checkers/NullabilityChecker.cpp test/Analysis/nullability.mm Index:

[PATCH] D12652: [Static Analyzer] Lambda support.

2015-09-04 Thread Gábor Horváth via cfe-commits
xazax.hun created this revision. xazax.hun added reviewers: dcoughlin, zaks.anna, jordan_rose, ted. xazax.hun added a subscriber: cfe-commits. This patch adds lambda support for the static analyzer. All of my initial tests are passed. Before this patch each time a LambdaExpr was encountered a

[PATCH] D12619: [Static Analyzer] Minor cleanups for the nullability checker.

2015-09-03 Thread Gábor Horváth via cfe-commits
xazax.hun created this revision. xazax.hun added reviewers: dcoughlin, zaks.anna. xazax.hun added a subscriber: cfe-commits. This patch contains minor cleanups and style fixes for the nullability checker. NFC. http://reviews.llvm.org/D12619 Files:

Re: [PATCH] D12619: [Static Analyzer] Minor cleanups for the nullability checker.

2015-09-03 Thread Gábor Horváth via cfe-commits
xazax.hun added a comment. They are in the anonymous namespace. Maybe it would be cleaner to move them outside of the namespace and preserve the static keyword? http://reviews.llvm.org/D12619 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

Re: [PATCH] D11468: [Static Analyzer] The first implementation of nullability checker.

2015-08-25 Thread Gábor Horváth via cfe-commits
xazax.hun updated this revision to Diff 33151. xazax.hun marked 30 inline comments as done. xazax.hun added a comment. Addressed the comments. Added some more tests. Added a design document. http://reviews.llvm.org/D11468 Files: docs/analyzer/nullability.rst

Re: [PATCH] D12381: [Static Analyzer] Merge the Objective-C Generics Checker into Dynamic Type Propagation checker.

2015-09-10 Thread Gábor Horváth via cfe-commits
xazax.hun added a comment. In http://reviews.llvm.org/D12381#241709, @xazax.hun wrote: > There are several fallouts from this review, so I decided to split this patch > up the following way: > > 1. I created a patch to incorporate the result of this review into > ObjCGenericsChecker:

Re: [PATCH] D12652: [Static Analyzer] Lambda support.

2015-09-10 Thread Gábor Horváth via cfe-commits
xazax.hun updated this revision to Diff 34498. xazax.hun added a comment. - Updated to latest trunk - Added test for the defensive inline check heuristic case - Added test for diagnostic within a lambda body - Added test for path notes http://reviews.llvm.org/D12652 Files:

[PATCH] D12848: [Static Analyzer] Nullability checker optimization.

2015-09-14 Thread Gábor Horváth via cfe-commits
xazax.hun created this revision. xazax.hun added reviewers: dcoughlin, zaks.anna, jordan_rose. xazax.hun added a subscriber: cfe-commits. Right now the nullability checker only tracks symbolic regions. For this reason if there are no dead symbols it is safe to skip the precondition checking. I

Re: [PATCH] D12889: [Static Analyzer] Generics Checker: When an ObjC method returns a specialized object, track it properly.

2015-09-15 Thread Gábor Horváth via cfe-commits
xazax.hun added inline comments. Comment at: lib/StaticAnalyzer/Checkers/DynamicTypePropagation.cpp:675 @@ +674,3 @@ + + QualType ResultType = Method->getReturnType().substObjCTypeArgs( + C, TypeArgs, ObjCSubstitutionContext::Result); zaks.anna wrote: >

Re: [PATCH] D12767: [Static Analyzer] Properly clean up the dynamic type information for dead regions.

2015-09-11 Thread Gábor Horváth via cfe-commits
xazax.hun updated this revision to Diff 34554. xazax.hun added a comment. - Addressed the comments. http://reviews.llvm.org/D12767 Files: include/clang/StaticAnalyzer/Core/PathSensitive/DynamicTypeMap.h include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h

Re: [PATCH] D12652: [Static Analyzer] Lambda support.

2015-09-11 Thread Gábor Horváth via cfe-commits
xazax.hun added inline comments. Comment at: include/clang/StaticAnalyzer/Core/AnalyzerOptions.h:515-517 @@ -511,1 +514,5 @@ + /// Returns true if lambdas should be inlined. Otherwise a sink node will be + /// generated each time a LambdaExpr is visited. + bool

Re: [PATCH] D12780: [analyzer] Add generateErrorNode() APIs to CheckerContext

2015-09-11 Thread Gábor Horváth via cfe-commits
xazax.hun added a comment. In general I like this change, the node handling of the checkers are more readable and reflects the intent in a clearer way. I have some comments inline. Comment at: include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h:244 @@ +243,3 @@ +

Re: [PATCH] D12767: [Static Analyzer] Properly clean up the dynamic type information for dead regions.

2015-09-11 Thread Gábor Horváth via cfe-commits
xazax.hun marked 2 inline comments as done. xazax.hun added a comment. http://reviews.llvm.org/D12767 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D12916: [Static Analyzer] Use generics related information to infer dynamic types.

2015-09-16 Thread Gábor Horváth via cfe-commits
xazax.hun created this revision. xazax.hun added reviewers: zaks.anna, dcoughlin, jordan_rose. xazax.hun added a subscriber: cfe-commits. This patch makes the DynamicTypePropagation checker utilize the information about generics. Using this additional information more precise inlining can be

Re: [PATCH] D12889: [Static Analyzer] Generics Checker: When an ObjC method returns a specialized object, track it properly.

2015-09-16 Thread Gábor Horváth via cfe-commits
xazax.hun added inline comments. Comment at: lib/StaticAnalyzer/Checkers/DynamicTypePropagation.cpp:680 @@ +679,3 @@ +return nullptr; + + QualType ResultType = Method->getReturnType().substObjCTypeArgs( zaks.anna wrote: > From above: > QualType

Re: [PATCH] D12916: [Static Analyzer] Use generics related information to infer dynamic types.

2015-09-17 Thread Gábor Horváth via cfe-commits
xazax.hun marked an inline comment as done. Comment at: lib/StaticAnalyzer/Checkers/DynamicTypePropagation.cpp:871 @@ +870,3 @@ + if (RetRegion && !State->get(RetRegion)) { +// TODO: we have duplicated information in DynamicTypeMap and +// MostSpecializedTypeArgsMap. We

Re: [PATCH] D12916: [Static Analyzer] Use generics related information to infer dynamic types.

2015-09-17 Thread Gábor Horváth via cfe-commits
xazax.hun updated this revision to Diff 35027. xazax.hun added a comment. Addressed the comments. http://reviews.llvm.org/D12916 Files: lib/StaticAnalyzer/Checkers/DynamicTypePropagation.cpp test/Analysis/DynamicTypePropagation.m Index: test/Analysis/DynamicTypePropagation.m

Re: [PATCH] D12906: [RFC] Bug identification("issue_hash") change for CmpRuns.py

2015-09-17 Thread Gábor Horváth via cfe-commits
xazax.hun added a comment. I was thinking a bit more, what would be the best way to determine what should we include in the hash. In order to determine that first we need to define the scope of the hash itself. There are several sensible choices such as: - identify bugs that were generated by

Re: [PATCH] D12906: [RFC] Bug identification("issue_hash") change for CmpRuns.py

2015-09-17 Thread Gábor Horváth via cfe-commits
xazax.hun added a comment. I can see two very differen directions on the two version of this patch. I think this is bad and we should pick one. In the other version we started to exclude some of the stuff (like filename) from the hash, since it is available already in the plist and gives the

[PATCH] D12852: [Static Analyzer] Moving nullability checkers to a top level package.

2015-09-14 Thread Gábor Horváth via cfe-commits
xazax.hun created this revision. xazax.hun added reviewers: zaks.anna, dcoughlin, jordan_rose. xazax.hun added a subscriber: cfe-commits. This patch is a preparation to enabling some of the nullability checks by default. 1. Moved nullability checkers to a top level package. The core package is

Re: [PATCH] D12852: [Static Analyzer] Moving nullability checkers to a top level package.

2015-09-14 Thread Gábor Horváth via cfe-commits
xazax.hun updated this revision to Diff 34705. xazax.hun added a comment. Removed an unintended comment formatting change. http://reviews.llvm.org/D12852 Files: lib/StaticAnalyzer/Checkers/Checkers.td lib/StaticAnalyzer/Checkers/NullabilityChecker.cpp test/Analysis/nullability.mm

Re: [PATCH] D13313: [clang-tidy] new check misc-no-reinterpret-cast

2015-10-01 Thread Gábor Horváth via cfe-commits
xazax.hun added a subscriber: xazax.hun. xazax.hun added a comment. If you check AvoidCStyleCastsCheck.cpp, it also suggest what kind of cast should you use to replace a C style cast. Probably, in some cases, the developers might be able to change the reinterpret_cast to something more type

Re: [PATCH] D12901: [Static Analyzer] Intersecting ranges and 64 bit to 32 bit truncations causing "System is over constrained." assertions.

2015-09-18 Thread Gábor Horváth via cfe-commits
xazax.hun added a comment. Hi! Thank you for the patch! What happens if you factor the "index + 1" expression out into a separate variable? E.g.: unsigned temp = index + 1; and use temp in the condition? My impression is that, the ranges does not model the overflow behavior correctly (which

Re: [PATCH] D12725: [analyzer] A fix for substraction of an integer from a pointer.

2015-09-18 Thread Gábor Horváth via cfe-commits
xazax.hun added a comment. In http://reviews.llvm.org/D12725#243150, @NoQ wrote: > Thanks, fixed :) Can you commit this or do you need someone to commit this for you? http://reviews.llvm.org/D12725 ___ cfe-commits mailing list

Re: [PATCH] D13099: [Analyzer] Don’t invalidate CXXThis when conservatively evaluating const methods (PR 21606)

2015-09-24 Thread Gábor Horváth via cfe-commits
xazax.hun added a comment. One more note. Do we want to support const_cast for this? A possible way to do that is to invalidate this, when a const cast appears in the body of the function. (However the body might not be available. It is only my opinion, but I would be ok to accept this patch

Re: [PATCH] D13099: [Analyzer] Don’t invalidate CXXThis when conservatively evaluating const methods (PR 21606)

2015-09-24 Thread Gábor Horváth via cfe-commits
xazax.hun added a comment. A general style comment: you could decrease the level of indentation using early returns. I have one more comment inline, otherwise it looks good to me. Comment at: lib/StaticAnalyzer/Core/CallEvent.cpp:422 @@ +421,3 @@ + // Check if this is a call

[PATCH] D12973: [Static Analyzer] General type checker based on dynamic type information.

2015-09-18 Thread Gábor Horváth via cfe-commits
xazax.hun created this revision. xazax.hun added reviewers: zaks.anna, dcoughlin, jordan_rose. xazax.hun added a subscriber: cfe-commits. This patch adds a checker that utilizes the information that was collected by DynamicTypePropagation and warns when the static type contradicts the dynamic

[PATCH] D12445: [Static Analyzer] Remove sinks from nullability checks.

2015-08-28 Thread Gábor Horváth via cfe-commits
xazax.hun created this revision. xazax.hun added reviewers: zaks.anna, dcoughlin, krememek, jordan_rose. xazax.hun added a subscriber: cfe-commits. With this patch a nullability violation no longer generates a sink node, so it does not cause any coverage loss for other checkers. From now on, it

Re: [PATCH] D12445: [Static Analyzer] Remove sinks from nullability checks.

2015-08-28 Thread Gábor Horváth via cfe-commits
xazax.hun updated this revision to Diff 33501. xazax.hun marked 6 inline comments as done. xazax.hun added a comment. Addressed the comments. http://reviews.llvm.org/D12445 Files: lib/StaticAnalyzer/Checkers/NullabilityChecker.cpp test/Analysis/nullability.mm Index:

[PATCH] D15227: [analyzer] Valist checkers.

2015-12-04 Thread Gábor Horváth via cfe-commits
xazax.hun created this revision. xazax.hun added reviewers: dcoughlin, zaks.anna, jordan_rose. xazax.hun added subscribers: dkrupp, cfe-commits. This checker was developed by Donat Nagy (m1nag...@gmail.com) and myself. It finds usages of uninitialized va_lists, and also unterminated va_lists.

Re: [PATCH] D15411: [clang-tidy] Check for suspicious string assignments.

2015-12-14 Thread Gábor Horváth via cfe-commits
xazax.hun marked 7 inline comments as done. Comment at: clang-tidy/misc/StringIntegerAssignmentCheck.cpp:19 @@ +18,3 @@ +namespace { +AST_MATCHER(QualType, isAnyCharacter) { return Node->isAnyCharacterType(); } +} // namespace aaron.ballman wrote: > I think this

Re: [PATCH] D15411: [clang-tidy] Check for suspicious string assignments.

2015-12-15 Thread Gábor Horváth via cfe-commits
xazax.hun added a comment. In http://reviews.llvm.org/D15411#310539, @alexfh wrote: > Thank you for the new awesome check! Thank you for the review. I committed the new matcher to clang as well. I went with isAnyCharacter name for now, but we can rename it anytime. Repository: rL LLVM

Re: [PATCH] D15411: [clang-tidy] Check for suspicious string assignments.

2015-12-14 Thread Gábor Horváth via cfe-commits
xazax.hun updated this revision to Diff 42710. xazax.hun marked 4 inline comments as done. xazax.hun added a comment. - Reimplemented fixits. - Addressed the review comments. http://reviews.llvm.org/D15411 Files: clang-tidy/misc/CMakeLists.txt clang-tidy/misc/MiscTidyModule.cpp

Re: [PATCH] D15411: [clang-tidy] Check for suspicious string assignments.

2015-12-14 Thread Gábor Horváth via cfe-commits
xazax.hun added inline comments. Comment at: clang-tidy/misc/StringIntegerAssignmentCheck.cpp:20 @@ +19,3 @@ +AST_MATCHER(QualType, isAnyCharacter) { return Node->isAnyCharacterType(); } +} // namespace + aaron.ballman wrote: > alexfh wrote: > > I prefer

Re: [PATCH] D15411: [clang-tidy] Check for suspicious string assignments.

2015-12-10 Thread Gábor Horváth via cfe-commits
xazax.hun updated this revision to Diff 42406. xazax.hun added a comment. Minor update to docs. http://reviews.llvm.org/D15411 Files: clang-tidy/misc/CMakeLists.txt clang-tidy/misc/MiscTidyModule.cpp clang-tidy/misc/StringAssignmentCheck.cpp clang-tidy/misc/StringAssignmentCheck.h

[PATCH] D15411: [clang-tidy] Check for suspicious string assignments.

2015-12-10 Thread Gábor Horváth via cfe-commits
xazax.hun created this revision. xazax.hun added a reviewer: alexfh. xazax.hun added subscribers: dkrupp, cfe-commits. It is possible to assign arbitrary integer types to strings. Sometimes it is the result of missing to_string call or apostrophes. This check aims to find such errors.

Re: [PATCH] D15411: [clang-tidy] Check for suspicious string assignments.

2015-12-10 Thread Gábor Horváth via cfe-commits
xazax.hun updated this revision to Diff 42427. xazax.hun marked 5 inline comments as done. xazax.hun added a comment. - Modified the patch according to the review. http://reviews.llvm.org/D15411 Files: clang-tidy/misc/CMakeLists.txt clang-tidy/misc/MiscTidyModule.cpp

Re: [PATCH] D15411: [clang-tidy] Check for suspicious string assignments.

2015-12-10 Thread Gábor Horváth via cfe-commits
xazax.hun added a comment. Thank you for the review. I have seen a few false positives in the llvm codebase. I agree that these kind of conversions are unfortunate but I am sure fixing this would cause a huge backward compatibility problem. Nontheless I also think that it might be something

Re: [PATCH] D15411: [clang-tidy] Check for suspicious string assignments.

2015-12-14 Thread Gábor Horváth via cfe-commits
xazax.hun updated this revision to Diff 42698. xazax.hun marked an inline comment as done. xazax.hun added a comment. - Addressed review comments. - Removed fixit suggestions. http://reviews.llvm.org/D15411 Files: clang-tidy/misc/CMakeLists.txt clang-tidy/misc/MiscTidyModule.cpp

[PATCH] D15924: [analyzer] Utility to extract the variable name from a memory region.

2016-01-06 Thread Gábor Horváth via cfe-commits
xazax.hun created this revision. xazax.hun added reviewers: zaks.anna, dcoughlin, Alexander_Droste. xazax.hun added subscribers: cfe-commits, dkrupp. This patch adds a small utility to extract variable name from a memory region. This patch does not contain any test or user yet. There are however

[PATCH] D15921: [analyzer] Utility to match function calls.

2016-01-06 Thread Gábor Horváth via cfe-commits
xazax.hun created this revision. xazax.hun added reviewers: zaks.anna, dcoughlin. xazax.hun added subscribers: cfe-commits, dkrupp. This patch adds a small utility to match function calls and Obj-C messages. This utility abstracts away the mutable keywords and the lazy initialization and

Re: [PATCH] D12761: MPI-Checker patch for Clang Static Analyzer

2016-01-06 Thread Gábor Horváth via cfe-commits
xazax.hun added inline comments. Comment at: tools/clang/lib/StaticAnalyzer/Checkers/MPI-Checker/Utility.h:54 @@ +53,3 @@ +/// \returns variable name for memory region +std::string variableName(const clang::ento::MemRegion *MR); + zaks.anna wrote: > Since this

Re: [PATCH] D15227: [analyzer] Valist checkers.

2015-12-22 Thread Gábor Horváth via cfe-commits
xazax.hun marked 9 inline comments as done. xazax.hun added a comment. It was tested on gcc and rAthena (https://github.com/rathena/rathena). It did not find any issues in those projects, but I was able to find some issues that I artificially put into those projects. Comment

[PATCH] D15007: [analyzer] Improve modelling of nullptr_t in the analyzer. Fix PR25414.

2015-11-26 Thread Gábor Horváth via cfe-commits
xazax.hun created this revision. xazax.hun added reviewers: zaks.anna, dcoughlin. xazax.hun added subscribers: cfe-commits, dkrupp. This is a fix for https://llvm.org/bugs/show_bug.cgi?id=25414 This patch is intended to improve the modelling of std::nullptr_t. http://reviews.llvm.org/D15007

Re: [PATCH] D14919: Fix IssueHash generation

2015-11-26 Thread Gábor Horváth via cfe-commits
xazax.hun added a comment. In http://reviews.llvm.org/D14919#297168, @seaneveson wrote: > I was wondering what sort of source code causes the crash, but I do think it > would be good to have a regression test. It is possible to generate bug reports without associated declaration, altough it

Re: [PATCH] D15007: [analyzer] Improve modelling of nullptr_t in the analyzer. Fix PR25414.

2015-11-26 Thread Gábor Horváth via cfe-commits
xazax.hun updated this revision to Diff 41221. xazax.hun added a comment. Improved test cases. http://reviews.llvm.org/D15007 Files: lib/StaticAnalyzer/Core/RegionStore.cpp test/Analysis/nullptr.cpp Index: test/Analysis/nullptr.cpp

Re: [PATCH] D15007: [analyzer] Improve modelling of nullptr_t in the analyzer. Fix PR25414.

2015-11-26 Thread Gábor Horváth via cfe-commits
xazax.hun added a comment. In http://reviews.llvm.org/D15007#297183, @NoQ wrote: > There's a little problem with the `shouldNotCrash()` test: the first warning > on `invokeF()` on line 107 generates a sink, and the rest of the function > never gets executed. It's probably a good idea to split

Re: add null pointer check

2015-11-30 Thread Gábor Horváth via cfe-commits
Hi! Thank you for reporting this. A more complete fix is available here: http://reviews.llvm.org/D14919 I recommend to use that one :) Best Regards, Gabor On 30 November 2015 at 21:38, Mathieu Baudet wrote: > Hello, > > While running some private CSA checkers on a

Re: [PATCH] D14919: Fix IssueHash generation

2015-12-01 Thread Gábor Horváth via cfe-commits
xazax.hun closed this revision. xazax.hun added a comment. Committed in r254394. http://reviews.llvm.org/D14919 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D15007: [analyzer] Improve modelling of nullptr_t in the analyzer. Fix PR25414.

2015-12-01 Thread Gábor Horváth via cfe-commits
xazax.hun added a comment. In http://reviews.llvm.org/D15007#298086, @dcoughlin wrote: > Gabor, thanks for taking a look at this! > > I'm not sure `RegionStore::getBinding()` is the right place to put this logic. > > First, not all dereferences of a `std::nullptr_t` value go through >

Re: [PATCH] D15007: [analyzer] Improve modelling of nullptr_t in the analyzer. Fix PR25414.

2015-12-01 Thread Gábor Horváth via cfe-commits
xazax.hun updated this revision to Diff 41494. xazax.hun added a comment. - Added the test case Devin suggested. - Implemented the fix Devin suggested. - Updated to latest trunk. http://reviews.llvm.org/D15007 Files: lib/StaticAnalyzer/Core/SValBuilder.cpp test/Analysis/nullptr.cpp Index:

Re: [PATCH] D14736: [analyzer] DeadStoresChecker: Treat locals captured by reference in C++ lambdas as escaped.

2015-11-27 Thread Gábor Horváth via cfe-commits
xazax.hun accepted this revision. xazax.hun added a comment. This revision is now accepted and ready to land. In the meantime I realized dead store analysis only works with local variables, so I think I answered my comment. It was commited in r253630 .

Re: [PATCH] D14919: Fix IssueHash generation

2015-11-24 Thread Gábor Horváth via cfe-commits
xazax.hun added inline comments. Comment at: include/clang/StaticAnalyzer/Core/IssueHash.h:42 @@ -41,1 +41,3 @@ + llvm::StringRef BugType, const Decl *D, + const LangOptions& LangOpts); Please

Re: [PATCH] D14203: [analyzer] Improve pointer arithmetic checker.

2015-11-24 Thread Gábor Horváth via cfe-commits
xazax.hun added inline comments. Comment at: lib/StaticAnalyzer/Checkers/PointerArithChecker.cpp:150 @@ +149,3 @@ +return getArrayRegion(Region, Polymorphic, AKind, C); + default: +break; xazax.hun wrote: > dcoughlin wrote: > > In general, I think it is

Re: [PATCH] D14203: [analyzer] Improve pointer arithmetic checker.

2015-11-24 Thread Gábor Horváth via cfe-commits
xazax.hun updated this revision to Diff 41022. xazax.hun marked 11 inline comments as done. xazax.hun added a comment. - Fixed some of the review comments. - Updated to latest trunk. http://reviews.llvm.org/D14203 Files: lib/StaticAnalyzer/Checkers/PointerArithChecker.cpp

Re: [PATCH] D14629: [analyzer] Configuration file for scan-build.

2015-11-21 Thread Gábor Horváth via cfe-commits
xazax.hun added a comment. Clang tidy can pass per checker configuration to the static analyzer at the moment. I think it should not be hard to extend it. http://reviews.llvm.org/D14629 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

Re: [PATCH] D15921: [analyzer] Utility to match function calls.

2016-01-08 Thread Gábor Horváth via cfe-commits
xazax.hun updated this revision to Diff 44325. xazax.hun added a comment. Updated the comments. http://reviews.llvm.org/D15921 Files: include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h lib/StaticAnalyzer/Checkers/SimpleStreamChecker.cpp

Re: [PATCH] D15921: [analyzer] Utility to match function calls.

2016-01-08 Thread Gábor Horváth via cfe-commits
xazax.hun updated this revision to Diff 44322. xazax.hun marked 4 inline comments as done. xazax.hun added a comment. - Removed support for matching ObjC messages. It might be added in a later. - Addressed review comments. http://reviews.llvm.org/D15921 Files:

Re: [PATCH] D16044: getDescriptiveName() for MemRegion

2016-06-13 Thread Gábor Horváth via cfe-commits
xazax.hun closed this revision. xazax.hun added a comment. This was committad as the part of http://reviews.llvm.org/rL272529 http://reviews.llvm.org/D16044 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

Re: [PATCH] D14277: [Analyzer] Make referenced SymbolMetadata live even if its region is dead

2016-06-13 Thread Gábor Horváth via cfe-commits
xazax.hun added a comment. Maybe it would be great to do a profiling before and after this patch? It looks like this is a hotspot of the analyzer: http://clang-developers.42468.n3.nabble.com/Analyzer-pretty-profiling-pictures-td4052016.html Repository: rL LLVM http://reviews.llvm.org/D14277

Re: [PATCH] D20811: [analyzer] Model some library functions

2016-06-01 Thread Gábor Horváth via cfe-commits
xazax.hun added a comment. It is great to model more widely used functions! However I think the LibraryFunctionsChecker name might be a bit to broad, wouldn't something like StdCLibraryFunctions be more informative? http://reviews.llvm.org/D20811

Re: [PATCH] D15924: [analyzer] Utility to extract the variable name from a memory region.

2016-01-08 Thread Gábor Horváth via cfe-commits
xazax.hun added inline comments. Comment at: lib/StaticAnalyzer/Core/MemRegion.cpp:586 @@ +585,3 @@ +return ""; + return nd->getName(); +} Alexander_Droste wrote: > Isn't calling `getDecl()` and `getName()` afterwards identical to > `printPretty()`? > Is it

  1   2   3   4   5   >