[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).

[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

[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

[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? > >

[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

[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; };

[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

[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-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

[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] 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

[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] 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] 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

[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

[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,

[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:

[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

[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

[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] 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

[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

[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

[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

[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

[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

[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

[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] D35109: [Analyzer] SValBuilder Comparison Rearrangement

2017-08-04 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. What do you suggest? Should we widen the type of the difference, or abandon this patch and revert back to the local solution I originally used in the iterator checker? https://reviews.llvm.org/D35109 ___

[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

[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] 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,

[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] 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

[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

[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.

[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

[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

[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); + }

[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

[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:

[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,

[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;

[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] 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 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] 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:

[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] 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:

[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

[PATCH] D35109: [Analyzer] SValBuilder Comparison Rearrangement

2017-08-01 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 109117. baloghadamsoftware added a comment. Overflow scenarios skipped. https://reviews.llvm.org/D35109 Files: lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp test/Analysis/svalbuilder-rearrange-comparisons.c Index:

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

2017-08-01 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 109126. baloghadamsoftware added a comment. Herald added a subscriber: JDevlieghere. Test changed. I made some bad throws reachable, but the frontend check still does detects them. https://reviews.llvm.org/D33537 Files:

[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

[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] D32642: [Analyzer] Iterator Checker - Part 2: Increment, decrement operators and ahead-of-begin checks

2017-06-22 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. I tried `SValBuilder::evalBinOp()` first but it did not help too much. It could decide only if I compared the same conjured symbols or different ones, but nothing more. It always gave me `UnknownVal`. Even if comparing ${conj_X} == ${conj_X} + n where n was

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

2017-06-22 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 103568. baloghadamsoftware added a comment. Minor fixes according to the comments. https://reviews.llvm.org/D32642 Files: lib/StaticAnalyzer/Checkers/IteratorChecker.cpp test/Analysis/Inputs/system-header-simulator-cxx.h

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

2017-06-23 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. Now I can improve `SValBuilder` to compare `{conj_X}+n` to `conj_X}+m`, but I am not sure if it helps to simplify `compare()` much. How to handle cases where I have to compare `{conj_X}+n` to `{conj_Y}+m`, an we have a range `[k..k]` for `{conj_X}-{conj_Y}`

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

2017-06-19 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. Any progress in the review? https://reviews.llvm.org/D32642 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2017-06-23 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. > I'm sure that simplification `(($x + N) + M) ~> ($x + (M + N))` is already > working in `SValBuilder`. No, it is unfortunately not working: I tried to increase `${conj_X}` by `1`, then again by `1`, and I got symbolic expression `(${conj_X}+1)+1)`.

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

2017-06-23 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 103728. baloghadamsoftware added a comment. `SymbolManager::getSymIntExpr()` replaced by `SValBuilder::evalBinOp()`, function `compact()` eliminated. https://reviews.llvm.org/D32642 Files: lib/StaticAnalyzer/Checkers/IteratorChecker.cpp

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

2017-05-26 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 100382. baloghadamsoftware added a comment. Ignoring bad_alloc. https://reviews.llvm.org/D33537 Files: clang-tidy/misc/CMakeLists.txt clang-tidy/misc/ExceptionEscapeCheck.cpp clang-tidy/misc/ExceptionEscapeCheck.h

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

2017-05-25 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware created this revision. Herald added a subscriber: mgorny. Finds functions which should not throw exceptions: Destructors, move constructors, move assignment operators, the main() function, swap() functions, functions marked with throw() or noexcept and functions given as

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

2017-05-25 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. Supersedes https://reviews.llvm.org/D32350 https://reviews.llvm.org/D33537 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D32350: [Analyzer] Exception checker for misuse: uncaught/noncompliant throws

2017-05-25 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware abandoned this revision. baloghadamsoftware added a comment. Superseded by https://reviews.llvm.org/D33537 https://reviews.llvm.org/D32350 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

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

2017-05-25 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. Any comments regarding the last changes? https://reviews.llvm.org/D32592 ___ 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-25 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 100239. baloghadamsoftware added a comment. Comments added and fixed. https://reviews.llvm.org/D32592 Files: include/clang/StaticAnalyzer/Checkers/Checkers.td lib/StaticAnalyzer/Checkers/CMakeLists.txt

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

2017-05-26 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 100369. baloghadamsoftware added a comment. Docs fixed according to the comments. https://reviews.llvm.org/D33537 Files: clang-tidy/misc/CMakeLists.txt clang-tidy/misc/ExceptionEscapeCheck.cpp clang-tidy/misc/ExceptionEscapeCheck.h

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

2017-05-26 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In https://reviews.llvm.org/D33537#764834, @Prazek wrote: > How is that compared to https://reviews.llvm.org/D19201 and the clang patch > mentioned in this patch? Actually, this check does much more. It does not only check for noexcept (and throw())

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

2017-05-26 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 100374. baloghadamsoftware added a comment. Check added to the Release Notes. https://reviews.llvm.org/D33537 Files: clang-tidy/misc/CMakeLists.txt clang-tidy/misc/ExceptionEscapeCheck.cpp clang-tidy/misc/ExceptionEscapeCheck.h

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

2017-06-02 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In https://reviews.llvm.org/D33537#770264, @aaron.ballman wrote: > I think we should try to get as much of this functionality in > https://reviews.llvm.org/D3 as possible; there is a considerable amount > of overlap between that functionality and this

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

2017-05-31 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 100848. baloghadamsoftware added a comment. Rebased to (committed) Part1 (https://reviews.llvm.org/rL304160) and updated according to comments. https://reviews.llvm.org/D32642 Files: lib/StaticAnalyzer/Checkers/IteratorChecker.cpp

[PATCH] D31370: [clang-tidy] Prototype to check for exception specification

2017-05-31 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. The matcher in https://reviews.llvm.org/D33537 could be reused here as well. Maybe I should make it common, but it is more complex than any of the common matchers. Repository: rL LLVM https://reviews.llvm.org/D31370

[PATCH] D19201: [clang-tidy] misc-throw-with-noexcept

2017-05-31 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. There is a patch (https://reviews.llvm.org/D33537) for a check which is a superset of this: It does not only check for noexcept (and throw()) functions, but also for destructors, move constructors, move assignments, the main() function, swap() functions and

[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 , SymbolRef Sym1, SymbolRef Sym2); +const llvm::APSInt *getDifference(ProgramStateRef State,

[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

[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

[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

[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] 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:

[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

[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.

[PATCH] D34508: [Analyzer] Bug Reporter Visitor to Display Values of Variables - PRELIMINARY!

2017-10-06 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. I am considering to restrict the assumptions to nodes marked as interesting and to the location of the bug. However, I have difficulties with the latter, it seems that the bug location itself is not part of the bug path. https://reviews.llvm.org/D34508

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

2017-10-06 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. I think that the acceptable false positive rate of a compiler warning is much lower than that of a Tidy check. So I understand that the fronted patch will not handle the indirect cases (which are the most important in my opinion) or the cases where there are

[PATCH] D35109: [Analyzer] SValBuilder Comparison Rearrangement

2017-10-06 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. It seems that Artem's suggestion is not enough (or I misunderstood it). So two options remain: either we drop this and revert to the local solution in the Iterator Checkers or we extend the type when rearranging the comparison. Which way to go?

[PATCH] D35109: [Analyzer] SValBuilder Comparison Rearrangement

2017-10-11 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. I tried to extend the type to avoid overflow scenarios. Unfortunately, this breaks essential calculations based on the overflow scenarios (e.g. ProgramSate::assumeInbound()). So I see no other option than to abandon this patch and return to the local

[PATCH] D35109: [Analyzer] SValBuilder Comparison Rearrangement

2017-09-26 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 116662. baloghadamsoftware added a comment. If both sides have concrete integers, they must be in range [min/4..max/4], if only one, it must be in range [min/2..max/2]. https://reviews.llvm.org/D35109 Files:

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

2017-09-01 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In https://reviews.llvm.org/D35110#854334, @zaks.anna wrote: > Is this blocked on the same reasons as what was raised in > https://reviews.llvm.org/D35109? No, it is blocked because https://reviews.llvm.org/D35109 is a prerequisite.

[PATCH] D35109: [Analyzer] SValBuilder Comparison Rearrangement

2017-09-01 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. Anna, Devin, should I proceed with Artem's suggested way? 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] D39048: Dump signed integers in SymIntExpr and IntSymExpr correctly

2017-10-18 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware created this revision. When dumping SymIntExpr or IntSymExpr signed numbers are dumped as unsigned, thus their two's complement is displayed. This small patch fixes this. https://reviews.llvm.org/D39048 Files: lib/StaticAnalyzer/Core/SymbolManager.cpp

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

2017-10-20 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware created this revision. Herald added subscribers: mgorny, srhines. A possible error is to write ``malloc(strlen(s+1))`` instead of ``malloc(strlen(s)+1)``. Unfortunately the former is also valid syntactically, but allocates less memory by two bytes (if ``s`` is at least one

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

2017-11-24 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. We take the conservative approach there: if a function has no `throw` specifier we handle it as it would have a `noexcept` specifier. https://reviews.llvm.org/D33537 ___ cfe-commits mailing list

[PATCH] D35109: [Analyzer] SValBuilder Comparison Rearrangement

2017-11-23 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. Let us summarize the possibilities: 1. Type extension approach. I tested it, all tests pass, and also in Devin's examples we do not infer narrower range than we should. (Wider do not matter.) I think this is the most complete solution and many checkers could

[PATCH] D39366: [ASTMatchers] Matchers for new[] operators

2017-11-23 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware closed this revision. baloghadamsoftware added a comment. Closed by commit https://reviews.llvm.org/rL318909. https://reviews.llvm.org/D39366 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D39367: [clang-tidy] Add support for operator new[] in check bugprone-misplaced-operator-in-strlen-in-alloc

2017-11-23 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware closed this revision. baloghadamsoftware added a comment. Closed by commit https://reviews.llvm.org/rL318912. https://reviews.llvm.org/D39367 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

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

2017-11-23 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In https://reviews.llvm.org/D33537#902242, @JonasToth wrote: > > Will this check find stuff like this (or is it part of the frontend) > > int throwing() { > throw int(42); > } > > int not_throwing() noexcept { > throwing(); > }

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

2017-11-23 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware closed this revision. baloghadamsoftware marked 2 inline comments as done. baloghadamsoftware added a comment. https://reviews.llvm.org/rL318906 and https://reviews.llvm.org/rL318907 https://reviews.llvm.org/D39121 ___

  1   2   3   4   5   6   7   8   9   10   >