[PATCH] D39121: [clang-tidy] Misplaced Operator in Strlen in Alloc

2017-11-06 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware marked 12 inline comments as done. baloghadamsoftware added inline comments. Comment at: test/clang-tidy/bugprone-misplaced-operator-in-strlen-in-alloc.c:1 +// RUN: %check_clang_tidy %s bugprone-misplaced-operator-in-strlen-in-alloc %t + aaron.

[PATCH] D35109: [Analyzer] SValBuilder Comparison Rearrangement

2017-11-15 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. Thank you for your respone! However, I think you (not you, Artem, but you three at Apple) do not really understand that I need to compare A+m to B+n not only because of the iterator range checking, but also in later parts. So your proposal means that I am not

[PATCH] D25660: [Analyzer] Checker for iterators dereferenced beyond their range.

2016-12-16 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In https://reviews.llvm.org/D25660#613519, @zaks.anna wrote: > Also, have you evaluated this on real codebases? What results do you see? Are > there any false positives found? Are there any true positives found? I am doing it right now. Unfortunately I found

[PATCH] D31097: [clang-tidy] don't warn about implicit widening casts in function calls

2017-03-22 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. Hi! There is an option to disable the checking of widening casts. It is enabled by default. You can disable it any time. Or, if you find too much false positives, we can discuss about setting this option to disabled as default. I am convinced that checking i

[PATCH] D29419: [Analyzer] Checker for mismatched iterators

2017-04-12 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware abandoned this revision. baloghadamsoftware marked an inline comment as done. baloghadamsoftware added a comment. Superseeded by patch https://reviews.llvm.org/D31975. https://reviews.llvm.org/D29419 ___ cfe-commits mailing list c

[PATCH] D28771: [Analyzer] Various fixes for the IteratorPastEnd checker

2017-04-12 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware abandoned this revision. baloghadamsoftware added a comment. Whole checker superseeded by https://reviews.llvm.org/D31975. https://reviews.llvm.org/D28771 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.o

[PATCH] D31097: [clang-tidy] don't warn about implicit widening casts in function calls

2017-04-18 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. OK, please create a patch where implicit casts are disabled by default. You can also find a new name for the checker. Repository: rL LLVM https://reviews.llvm.org/D31097 ___ cfe-commits mailing list cfe-commit

[PATCH] D31097: [clang-tidy] don't warn about implicit widening casts in function calls

2017-04-18 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. Or I can do it for you if you wish. Repository: rL LLVM https://reviews.llvm.org/D31097 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D32164: [clang-tidy] misc-misplaced-widening-cast: Disable checking of implicit widening casts by default

2017-04-18 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware created this revision. Herald added a subscriber: whisperity. Users reported some false positives using this check. This patch sets the default value of the option for checking implicit widening casts to false. We also suggest renaming the check to something like missing-or-mi

[PATCH] D28771: [Analyzer] Various fixes for the IteratorPastEnd checker

2017-01-16 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware created this revision. baloghadamsoftware added reviewers: zaks.anna, NoQ. baloghadamsoftware added subscribers: xazax.hun, o.gyorgy, cfe-commits. This patch fixes some issues for the IteratorPastEnd checkers. There are basically two main issues this patch targets: one is the h

[PATCH] D27202: [analyzer] Do not conjure a symbol for return value of a conservatively evaluated function

2017-01-16 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. Any progress regarding this patch? Is https://reviews.llvm.org/D26837 necessarily a dependency, or we just need isCompoundType() function? This function could be moved to a separate patch so the dependency could be removed. https://reviews.llvm.org/D27202

[PATCH] D29183: [Analysis] Fix for call graph to correctly handle nested call expressions

2017-01-26 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware created this revision. Take the following example: class Int { public: Int(int n = 0): num(n) {} Int(const Int& rhs): num(rhs.num) {} Int& operator=(const Int& rhs) { num = rhs.num; } operator int() { return num; } private: int num; }; templa

[PATCH] D29183: [Analysis] Fix for call graph to correctly handle nested call expressions

2017-01-26 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In https://reviews.llvm.org/D29183#657669, @xazax.hun wrote: > Great find! Could you transform your examole into a testcasr that fails > before this patch? I think there should be already some tests for call > graphs that you can take a look at. Yes, but I

[PATCH] D29183: [Analysis] Fix for call graph to correctly handle nested call expressions

2017-01-26 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. Some comments how I found this bug. I got some strange false positives even after the fix for the iterator past end checker (https://reviews.llvm.org/D28771). I could reproduce it with the following code: #include using std::list; using std::prev;

[PATCH] D29183: [Analysis] Fix for call graph to correctly handle nested call expressions

2017-01-26 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. I wonder if this could also be a problem for nested messages in Objective-C, since the call for VisitChildren() is also missing from VisitObjCMessageExpr()... https://reviews.llvm.org/D29183 ___ cfe-commits mail

[PATCH] D29183: [Analysis] Fix for call graph to correctly handle nested call expressions

2017-01-26 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In https://reviews.llvm.org/D29183#657706, @NoQ wrote: > Hmm, we should have done better work reviewing > https://reviews.llvm.org/D28905. Oh, someone was quicker than me by one week... https://reviews.llvm.org/D29183 ___

[PATCH] D28771: [Analyzer] Various fixes for the IteratorPastEnd checker

2017-01-31 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 86428. baloghadamsoftware added a comment. Updates based on the comments. https://reviews.llvm.org/D28771 Files: lib/StaticAnalyzer/Checkers/IteratorPastEndChecker.cpp test/Analysis/Inputs/system-header-simulator-cxx.h test/Analysis/diagnos

[PATCH] D28771: [Analyzer] Various fixes for the IteratorPastEnd checker

2017-01-31 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added inline comments. Comment at: lib/StaticAnalyzer/Checkers/IteratorPastEndChecker.cpp:530 + auto value = RVal; + if (auto loc = value.getAs()) { +value = State->getRawSVal(*loc); NoQ wrote: > Is there a test case for this hack? > > I

[PATCH] D29419: [Analyzer] Checker for mismatched iterators

2017-02-01 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware created this revision. A new checker to check whether multiple iterators which should refer to the same container refer to different ones. Here we include comparisons, constructors which take an iterator pair and any template function which takes iterator pair(s). https://r

[PATCH] D29419: [Analyzer] Checker for mismatched iterators

2017-02-01 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 86709. baloghadamsoftware added a comment. Herald added a subscriber: mgorny. The checker itself disappeared mystically from the previous diff... https://reviews.llvm.org/D29419 Files: include/clang/StaticAnalyzer/Checkers/Checkers.td lib/Sta

[PATCH] D28771: [Analyzer] Various fixes for the IteratorPastEnd checker

2017-02-09 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added inline comments. Comment at: lib/StaticAnalyzer/Checkers/IteratorPastEndChecker.cpp:530 + auto value = RVal; + if (auto loc = value.getAs()) { +value = State->getRawSVal(*loc); NoQ wrote: > baloghadamsoftware wrote: > > NoQ wrote: >

[PATCH] D29419: [Analyzer] Checker for mismatched iterators

2017-02-09 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In https://reviews.llvm.org/D29419#671839, @NoQ wrote: > This one looks similar to the `IteratorPastEnd` checker, so much that i'd > definitely advice re-using some code. At the very least, functions like > `isIterator()` should definitely deserve a header so

[PATCH] D35109: [Analyzer] SValBuilder Comparison Rearrangement

2017-07-07 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware created this revision. Since the range-based constraint manager (default) is weak in handling comparisons where symbols are on both sides it is wise to rearrange them to have symbols only on the left side. Thus e.g. `A + n >= B + m` becomes `A - B >= m - n` which enables the

[PATCH] D35110: [Analyzer] Constraint Manager Negates Difference

2017-07-07 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware created this revision. If range `[m .. n]` is stored for symbolic expression `A - B`, then we can deduce the range for `B - A` which is [-n .. -m]. This is only true for signed types, unless the range is `[0 .. 0]`. https://reviews.llvm.org/D35110 Files: lib/StaticAnalyze

[PATCH] D35110: [Analyzer] Constraint Manager Negates Difference

2017-07-07 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 105593. baloghadamsoftware added a comment. Wrong patch files was uploaded first. https://reviews.llvm.org/D35110 Files: lib/StaticAnalyzer/Core/RangeConstraintManager.cpp test/Analysis/ptr-arith.c Index: test/Analysis/ptr-arith.c ==

[PATCH] D32642: [Analyzer] Iterator Checker - Part 2: Increment, decrement operators and ahead-of-begin checks

2017-07-07 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 105594. baloghadamsoftware added a comment. Simplified for enhanced SValBuilder and ConstraintManager. https://reviews.llvm.org/D32642 Files: lib/StaticAnalyzer/Checkers/IteratorChecker.cpp test/Analysis/Inputs/system-header-simulator-cxx.h

[PATCH] D33537: [clang-tidy] Exception Escape Checker

2017-07-07 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In https://reviews.llvm.org/D33537#771274, @aaron.ballman wrote: > The check in https://reviews.llvm.org/D3 is using a CFG, not just > checking direct throws. I tested the latest revision (the fronted patch already included) on my test file. Disregardin

[PATCH] D35109: [Analyzer] SValBuilder Comparison Rearrangement

2017-07-07 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 105628. baloghadamsoftware added a comment. Type check added and restricted to additive operators. https://reviews.llvm.org/D35109 Files: lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp test/Analysis/std-c-library-functions.c test/Analysis/sv

[PATCH] D35109: [Analyzer] SValBuilder Comparison Rearrangement

2017-07-07 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware marked an inline comment as done. baloghadamsoftware added inline comments. Comment at: lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp:583 +newRhs = BasicVals.evalAPSInt(BO_Add, *lInt, *rInt); +reverse = (lop == BO_Add); + } else

[PATCH] D35109: [Analyzer] SValBuilder Comparison Rearrangement

2017-07-07 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware marked an inline comment as done. baloghadamsoftware added a comment. In https://reviews.llvm.org/D35109#801921, @NoQ wrote: > Because integer promotion rules are tricky, could we, for now, avoid dealing > with the situation when left-hand side and right-hand side and the resu

[PATCH] D35109: [Analyzer] SValBuilder Comparison Rearrangement

2017-07-12 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In https://reviews.llvm.org/D35109#806156, @NoQ wrote: > I think you might also need to convert `APSInt`s to an appropriate type, as > done above. Type of right-hand-side `APSInt`s do not necessarily coincide > with the type of the left-hand-side symbol or of

[PATCH] D35109: [Analyzer] SValBuilder Comparison Rearrangement

2017-07-13 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. I think we should exclude unsigned types completely. `A >= B` is converted to `A - B >= 0`, thus the range of `A - B` is `[0 .. INT_MAX]` which is the full range for the unsigned type. This implies that upon any conditional statement `if (A >= B) ...` the ran

[PATCH] D35110: [Analyzer] Constraint Manager Negates Difference

2017-07-13 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added inline comments. Comment at: lib/StaticAnalyzer/Core/RangeConstraintManager.cpp:511 + SSE->getLHS()->getType()->isSignedIntegerOrEnumerationType() || + SSE->getLHS()->getType()->isPointerType()) { + return negV->Negate(BV, F);

[PATCH] D33333: Emit warning when throw exception in destruct or dealloc functions which has a (possible implicit) noexcept specifier

2017-07-13 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. I tested the latest revision (this fronted patch already included) on my test file in https://reviews.llvm.org/D33537. Disregarding of the (not so important) check-specific parameters (`EnabledFunctions` and `IgnoredExceptions`) I do not get warnings for any

[PATCH] D35109: [Analyzer] SValBuilder Comparison Rearrangement

2017-07-14 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. The other possibility is to make the difference signed. https://reviews.llvm.org/D35109 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D35109: [Analyzer] SValBuilder Comparison Rearrangement

2017-07-14 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 106626. baloghadamsoftware added a comment. Difference of unsigned is converted to signed. https://reviews.llvm.org/D35109 Files: include/clang/AST/ASTContext.h lib/AST/ASTContext.cpp lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp test/Ana

[PATCH] D35110: [Analyzer] Constraint Manager Negates Difference

2017-07-14 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 106627. baloghadamsoftware added a comment. Type selection simplified, FIXME added. https://reviews.llvm.org/D35110 Files: lib/StaticAnalyzer/Core/RangeConstraintManager.cpp test/Analysis/constraint_manager_negate_difference.c test/Analysis

[PATCH] D35109: [Analyzer] SValBuilder Comparison Rearrangement

2017-07-18 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 107032. baloghadamsoftware added a comment. Rearrangement of unsigned comparison removed (FIXME added). Comment regarding the types of integer constants added. https://reviews.llvm.org/D35109 Files: lib/StaticAnalyzer/Core/SimpleSValBuilder.cp

[PATCH] D35110: [Analyzer] Constraint Manager Negates Difference

2017-07-18 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added inline comments. Comment at: lib/StaticAnalyzer/Core/RangeConstraintManager.cpp:511 + SSE->getLHS()->getType()->isSignedIntegerOrEnumerationType() || + SSE->getLHS()->getType()->isPointerType()) { + return negV->Negate(BV, F);

[PATCH] D35110: [Analyzer] Constraint Manager Negates Difference

2017-07-18 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 107079. baloghadamsoftware added a comment. I think I checked the type of the left side of the difference, not the difference itself. Thus the difference is not a pointer type, it is a signed integer type, the tests pass when I remove that line.

[PATCH] D35937: [clang-tidy] Add new readability non-idiomatic static access

2017-07-28 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added inline comments. Comment at: test/clang-tidy/readability-static-accessed-through-instance.cpp:34 + // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: static member accessed through instance [readability-static-accessed-through-instance] + // CHECK-FIXES: {{^

[PATCH] D35937: [clang-tidy] Add new readability non-idiomatic static access

2017-07-28 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. I am not sure whether we should copy with such ugly things as overloaded member access operators with side effects, but they can also cause troubles using this fix: #include using std::cout; using std::endl; struct C { static int N; int

[PATCH] D35937: [clang-tidy] Add new readability non-idiomatic static access

2017-07-28 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added inline comments. Comment at: test/clang-tidy/readability-static-accessed-through-instance.cpp:34 + // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: static member accessed through instance [readability-static-accessed-through-instance] + // CHECK-FIXES: {{^

[PATCH] D32747: [Analyzer] Iterator Checker - Part 3: Invalidation check, first for (copy) assignments

2018-01-15 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added inline comments. Comment at: lib/StaticAnalyzer/Checkers/IteratorChecker.cpp:605 + if (Pos && !Pos->isValid()) { +// If I do not put a tag here, some invalidation tests will fail +static CheckerProgramPointTag Tag("InvalidatedIteratorChecker", --

[PATCH] D32747: [Analyzer] Iterator Checker - Part 3: Invalidation check, first for (copy) assignments

2018-01-15 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 129870. baloghadamsoftware added a comment. Rebased to current Part 2. https://reviews.llvm.org/D32747 Files: include/clang/StaticAnalyzer/Checkers/Checkers.td lib/StaticAnalyzer/Checkers/IteratorChecker.cpp test/Analysis/Inputs/system-head

[PATCH] D32845: [Analyzer] Iterator Checker - Part 4: Mismatched iterator checker for function parameters

2018-01-15 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 129871. baloghadamsoftware added a comment. Rebased to current Part 3. Comment added. https://reviews.llvm.org/D32845 Files: include/clang/StaticAnalyzer/Checkers/Checkers.td lib/StaticAnalyzer/Checkers/IteratorChecker.cpp test/Analysis/Inp

[PATCH] D32859: [Analyzer] Iterator Checker - Part 5: Move Assignment of Containers

2018-01-16 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 129960. baloghadamsoftware added a comment. Rebased to current part 4. New tests added. Comments added. https://reviews.llvm.org/D32859 Files: lib/StaticAnalyzer/Checkers/IteratorChecker.cpp test/Analysis/mismatched-iterator.cpp Index: test/

[PATCH] D32747: [Analyzer] Iterator Checker - Part 3: Invalidation check, first for (copy) assignments

2018-01-17 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. Thanks you for your comments! I have one question: Comment at: lib/StaticAnalyzer/Checkers/IteratorChecker.cpp:1256 +if (Cond(Reg.second)) { + State = setIteratorPosition(State, Reg.first, Proc(Reg.second)); +} a

[PATCH] D32845: [Analyzer] Iterator Checker - Part 4: Mismatched iterator checker for function parameters

2018-01-17 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware marked an inline comment as done. baloghadamsoftware added inline comments. Comment at: lib/StaticAnalyzer/Checkers/IteratorChecker.cpp:382 } + } else if (!isa(&Call)) { +// The main purpose of iterators is to abstract away from different

[PATCH] D32747: [Analyzer] Iterator Checker - Part 3: Invalidation check, first for (copy) assignments

2018-01-17 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 130149. baloghadamsoftware added a comment. Updated according to the comments. https://reviews.llvm.org/D32747 Files: include/clang/StaticAnalyzer/Checkers/Checkers.td lib/StaticAnalyzer/Checkers/IteratorChecker.cpp test/Analysis/Inputs/sys

[PATCH] D32845: [Analyzer] Iterator Checker - Part 4: Mismatched iterator checker for function parameters

2018-01-17 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 130174. baloghadamsoftware marked an inline comment as done. baloghadamsoftware added a comment. Updated according to some comments. https://reviews.llvm.org/D32845 Files: include/clang/StaticAnalyzer/Checkers/Checkers.td lib/StaticAnalyzer/C

[PATCH] D32860: [Analyzer] Iterator Checker - Part 6: Mismatched iterator checker for constructors and comparisons

2018-01-17 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 130186. baloghadamsoftware added a comment. Rebased. https://reviews.llvm.org/D32860 Files: lib/StaticAnalyzer/Checkers/IteratorChecker.cpp test/Analysis/mismatched-iterator.cpp Index: test/Analysis/mismatched-iterator.cpp ==

[PATCH] D32859: [Analyzer] Iterator Checker - Part 5: Move Assignment of Containers

2018-01-17 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 130185. baloghadamsoftware added a comment. Rebased. https://reviews.llvm.org/D32859 Files: lib/StaticAnalyzer/Checkers/IteratorChecker.cpp test/Analysis/mismatched-iterator.cpp Index: test/Analysis/mismatched-iterator.cpp ==

[PATCH] D41938: [Analyzer] SValBuilder Comparison Rearrangement (with Restrictions and Analyzer Option)

2018-01-18 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 130403. baloghadamsoftware added a comment. Updated according to the comments. https://reviews.llvm.org/D41938 Files: include/clang/StaticAnalyzer/Core/AnalyzerOptions.h lib/StaticAnalyzer/Core/AnalyzerOptions.cpp lib/StaticAnalyzer/Core/Si

[PATCH] D41938: [Analyzer] SValBuilder Comparison Rearrangement (with Restrictions and Analyzer Option)

2018-01-24 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. Thank you for your comments. Since the original author of this particular code is Artem, I think he will answer your questions. https://reviews.llvm.org/D41938 ___ cfe-commits mailing list cfe-commits@lists.llvm.

[PATCH] D29419: [Analyzer] Checker for mismatched iterators

2017-02-20 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 89123. baloghadamsoftware added a comment. Updated according to the comments. https://reviews.llvm.org/D29419 Files: include/clang/StaticAnalyzer/Checkers/Checkers.td lib/StaticAnalyzer/Checkers/CMakeLists.txt lib/StaticAnalyzer/Checkers/Mi

[PATCH] D29419: [Analyzer] Checker for mismatched iterators

2017-02-20 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware marked 2 inline comments as done. baloghadamsoftware added inline comments. Comment at: lib/StaticAnalyzer/Checkers/MismatchedIteratorChecker.cpp:311 + +void MismatchedIteratorChecker::checkPostStmt(const DeclStmt *DS, +

[PATCH] D28771: [Analyzer] Various fixes for the IteratorPastEnd checker

2017-02-21 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 89211. baloghadamsoftware added a comment. checkBind replaces checking of DeclStmt, CXXConstructExpr and assignment operators. Incremention by 0 is not a bug anymore regardless the position of the iterator. https://reviews.llvm.org/D28771 Files

[PATCH] D28771: [Analyzer] Various fixes for the IteratorPastEnd checker

2017-02-21 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added inline comments. Comment at: lib/StaticAnalyzer/Checkers/IteratorPastEndChecker.cpp:530 + auto value = RVal; + if (auto loc = value.getAs()) { +value = State->getRawSVal(*loc); NoQ wrote: > baloghadamsoftware wrote: > > NoQ wrote: >

[PATCH] D26837: [analyzer] Litter the SVal/SymExpr/MemRegion class hierarchy with asserts.

2016-12-05 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added inline comments. Comment at: include/clang/StaticAnalyzer/Core/PathSensitive/SVals.h:282 + static inline bool isCompoundType(QualType T) { +return T->isArrayType() || T->isRecordType() || Could you please move this function into a

[PATCH] D25660: [Analyzer] Checker for iterators dereferenced beyond their range.

2016-12-08 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 80728. baloghadamsoftware marked 4 inline comments as done. baloghadamsoftware added a comment. Minor corrections, comments, some new tests, test input headers merged. https://reviews.llvm.org/D25660 Files: include/clang/StaticAnalyzer/Checkers

[PATCH] D25660: [Analyzer] Checker for iterators dereferenced beyond their range.

2016-12-08 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. https://reviews.llvm.org/D27202 is now a dependency, but cannot add it. Comment at: lib/StaticAnalyzer/Checkers/IteratorPastEndChecker.cpp:166 +IteratorPastEndChecker::IteratorPastEndChecker() { + PastEndBugType.reset(new BugType(this, "Iter

[PATCH] D27202: [analyzer] Do not conjure a symbol for return value of a conservatively evaluated function

2016-12-08 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. Could you please remove the IteratorPastEndChecker file differences from this patch and make https://reviews.llvm.org/D25660 dependent on this one? https://reviews.llvm.org/D27202 ___ cfe-commits mailing list cfe

[PATCH] D25660: [Analyzer] Checker for iterators dereferenced beyond their range.

2016-12-13 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 81224. baloghadamsoftware added a comment. Now isInStdNamespace is used. Hack is back so https://reviews.llvm.org/D27202 is not a dependency now. https://reviews.llvm.org/D25660 Files: include/clang/StaticAnalyzer/Checkers/Checkers.td lib/St

[PATCH] D31975: [Analyzer] Iterator Checkers

2017-04-20 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. Hello! I am not sure how to split it to incremental patches. As I mentioned in the description, the state of the iterator position is always tracked. So if I remove some of the checks it does not make the patch much smaller, since the checking part is quite s

[PATCH] D32350: [Analyzer] Exception Checker

2017-04-21 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware created this revision. Herald added a subscriber: mgorny. This is an old checker used only internally until now. The original author is Bence Babati, I added him as a subscriber. The checker checks whather exceptions escape the main() function, destructors. functions with exc

[PATCH] D31975: [Analyzer] Iterator Checkers

2017-04-26 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. Thank you for your help. Actually, I did neither merge the patches nor the checkers. Based on the experiences in the prototype I created a totally new checker. Incremental development sounds good, but I did a lot of experimenting in this particular checker,

[PATCH] D32592: [Analyzer] Iterator Checker - Part1: Minimal Checker for a Simple Test Case

2017-04-27 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware created this revision. Herald added a subscriber: mgorny. This is the first part of the new Iterator Checker. This part contains the very core infrastructure. It only checks for out-of-range iterators in a very simple case. https://reviews.llvm.org/D32592 Files: include/c

[PATCH] D32592: [Analyzer] Iterator Checker - Part1: Minimal Checker for a Simple Test Case

2017-04-28 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 97060. baloghadamsoftware added a comment. Checker and test included now :-) https://reviews.llvm.org/D32592 Files: include/clang/StaticAnalyzer/Checkers/Checkers.td lib/StaticAnalyzer/Checkers/CMakeLists.txt lib/StaticAnalyzer/Checkers/Ite

[PATCH] D32592: [Analyzer] Iterator Checker - Part1: Minimal Checker for a Simple Test Case

2017-05-04 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added inline comments. Comment at: lib/StaticAnalyzer/Checkers/IteratorChecker.cpp:211-214 +std::pair +createDifference(SymbolManager &SymMgr, SymbolRef Sym1, SymbolRef Sym2); +const llvm::APSInt *getDifference(ProgramStateRef State, SymbolRef Sym1, +

[PATCH] D32859: [Analyzer] Iterator Checker - Part 5: Move Assignment of Containers

2017-05-04 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware created this revision. If a container is moved by its move assignment operator, according to the standard all their iterators except the past-end iterators remain valid but refer to the new container. This patch introduces support for this case in the iterator checkers. htt

[PATCH] D32860: [Analyzer] Iterator Checker - Part 6: Mismatched iterator checker for constructors and comparisons

2017-05-04 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware created this revision. Extension of the mismatched iterator checker for constructors taking range of first..last (first and last must be iterators of the same container) and also for comparisons of iterators of different containers (one does not compare iterators of different

[PATCH] D32902: [Analyzer] Iterator Checker - Part 7: Support for push and pop operations

2017-05-05 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 97942. baloghadamsoftware added a comment. Wrong diff. https://reviews.llvm.org/D32902 Files: lib/StaticAnalyzer/Checkers/IteratorChecker.cpp test/Analysis/Inputs/system-header-simulator-cxx.h test/Analysis/diagnostics/explicit-suppression.

[PATCH] D32904: [Analyzer] Iterator Checker - Part 8: Support for assign, clear, insert, emplace and erase operations

2017-05-05 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware created this revision. This patch adds support for the following operations in the iterator checkers: assign, clear, insert, insert_after, emplace, emplace_after, erase and erase_after. This affects mismatched iterator checks ("this" and parameter must match) and invalidation

[PATCH] D32905: [Analyzer] Iterator Checker - Part 9: Evaluation of std::find-like calls

2017-05-05 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware created this revision. This patch adds explicit evaluation of the following functions: std::find, std::find_end, std::find_first_of, std::find_if, std::find_if_not, std::lower_bound, std::upper_bound, std::search and std::search_n. On the one hand this is an optimization sinc

[PATCH] D32906: [Analyzer] Iterator Checker - Part 10: Support for iterators passed as parameter

2017-05-05 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware created this revision. check::Bind() is not invoked for parameter passing. We use a trick instead: in checkBeginFunction we copy the positions of iterator parameters from the arguments to the parameters. https://reviews.llvm.org/D32906 Files: lib/StaticAnalyzer/Checkers/I

[PATCH] D31975: [Analyzer] Iterator Checkers

2017-05-05 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. Split to 10 parts. https://reviews.llvm.org/D31975 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D32592: [Analyzer] Iterator Checker - Part 1: Minimal Checker for a Simple Test Case

2017-05-09 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 98275. baloghadamsoftware marked 11 inline comments as done. baloghadamsoftware added a comment. Updated according to the review. https://reviews.llvm.org/D32592 Files: include/clang/StaticAnalyzer/Checkers/Checkers.td lib/StaticAnalyzer/Chec

[PATCH] D32592: [Analyzer] Iterator Checker - Part 1: Minimal Checker for a Simple Test Case

2017-05-09 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In https://reviews.llvm.org/D32592#747132, @NoQ wrote: > Then, in methods that deal with iterator `SVal`s directly, i wish we had > hints explaining what's going on in these ~7 cases. In my opinion, that'd > greatly help people understand the code later, and

[PATCH] D101790: [clang-tidy] Aliasing: Add support for passing the variable into a function by reference.

2021-05-04 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In D101790#2734937 , @NoQ wrote: > +Adam, the original author of bugprone-redundant-branch-condition. Adam, do > you have any thoughts regarding the tests regressed by this patch? Are they > something we should absolu

<    5   6   7   8   9   10