r322780 - [analyzer] operator new: Fix memory space for the returned region.

2018-01-17 Thread Artem Dergachev via cfe-commits
Author: dergachev Date: Wed Jan 17 14:58:35 2018 New Revision: 322780 URL: http://llvm.org/viewvc/llvm-project?rev=322780&view=rev Log: [analyzer] operator new: Fix memory space for the returned region. Make sure that with c++-allocator-inlining=true we have the return value of conservatively eva

r322781 - [analyzer] operator new: Fix ambigious type name.

2018-01-17 Thread Artem Dergachev via cfe-commits
Author: dergachev Date: Wed Jan 17 15:03:25 2018 New Revision: 322781 URL: http://llvm.org/viewvc/llvm-project?rev=322781&view=rev Log: [analyzer] operator new: Fix ambigious type name. Hopefully fixes an MSVC buildbot failure. Modified: cfe/trunk/lib/StaticAnalyzer/Core/ExprEngine.cpp Modi

r322787 - [analyzer] operator new: Add a new checker callback, check::NewAllocator.

2018-01-17 Thread Artem Dergachev via cfe-commits
Author: dergachev Date: Wed Jan 17 15:46:13 2018 New Revision: 322787 URL: http://llvm.org/viewvc/llvm-project?rev=322787&view=rev Log: [analyzer] operator new: Add a new checker callback, check::NewAllocator. The callback runs after operator new() and before the construction and allows the check

r322790 - [analyzer] NFC: operator new: Fix new(nothrow) definition in tests.

2018-01-17 Thread Artem Dergachev via cfe-commits
Author: dergachev Date: Wed Jan 17 16:03:43 2018 New Revision: 322790 URL: http://llvm.org/viewvc/llvm-project?rev=322790&view=rev Log: [analyzer] NFC: operator new: Fix new(nothrow) definition in tests. Fix the const qualifier so that the operator defined in the tests indeed does override the de

r322791 - [analyzer] operator new: Fix path diagnostics around the operator call.

2018-01-17 Thread Artem Dergachev via cfe-commits
Author: dergachev Date: Wed Jan 17 16:10:21 2018 New Revision: 322791 URL: http://llvm.org/viewvc/llvm-project?rev=322791&view=rev Log: [analyzer] operator new: Fix path diagnostics around the operator call. Implements finding appropriate source locations for intermediate diagnostic pieces in pat

r322795 - [analyzer] Suppress "this" pointer escape during construction.

2018-01-17 Thread Artem Dergachev via cfe-commits
Author: dergachev Date: Wed Jan 17 16:44:41 2018 New Revision: 322795 URL: http://llvm.org/viewvc/llvm-project?rev=322795&view=rev Log: [analyzer] Suppress "this" pointer escape during construction. Pointer escape event notifies checkers that a pointer can no longer be reliably tracked by the ana

r322796 - [analyzer] operator new: Add a new ProgramPoint for check::NewAllocator.

2018-01-17 Thread Artem Dergachev via cfe-commits
Author: dergachev Date: Wed Jan 17 16:50:19 2018 New Revision: 322796 URL: http://llvm.org/viewvc/llvm-project?rev=322796&view=rev Log: [analyzer] operator new: Add a new ProgramPoint for check::NewAllocator. Add PostAllocatorCall program point to represent the moment in the analysis between the

r322797 - [analyzer] operator new: Fix callback order for CXXNewExpr.

2018-01-17 Thread Artem Dergachev via cfe-commits
Author: dergachev Date: Wed Jan 17 16:53:50 2018 New Revision: 322797 URL: http://llvm.org/viewvc/llvm-project?rev=322797&view=rev Log: [analyzer] operator new: Fix callback order for CXXNewExpr. PreStmt was never called. Additionally, under c++-allocator-inlining=true, PostStmt was called twice

r322798 - [analyzer] NFC: Use "= default" for default ProgramPoint constructors.

2018-01-17 Thread Artem Dergachev via cfe-commits
Author: dergachev Date: Wed Jan 17 16:55:29 2018 New Revision: 322798 URL: http://llvm.org/viewvc/llvm-project?rev=322798&view=rev Log: [analyzer] NFC: Use "= default" for default ProgramPoint constructors. Differential Revision: https://reviews.llvm.org/D41935 Modified: cfe/trunk/include/cl

r322799 - [analyzer] NFC: RetainCount: Protect from dumping raw region to path notes.

2018-01-17 Thread Artem Dergachev via cfe-commits
Author: dergachev Date: Wed Jan 17 17:01:56 2018 New Revision: 322799 URL: http://llvm.org/viewvc/llvm-project?rev=322799&view=rev Log: [analyzer] NFC: RetainCount: Protect from dumping raw region to path notes. MemRegion::getString() is a wrapper around MemRegion::dump(), which is not user-frien

r322804 - [analyzer] NFC: Remove unused method - BugReporter::RemoveUnneededCalls().

2018-01-17 Thread Artem Dergachev via cfe-commits
Author: dergachev Date: Wed Jan 17 17:40:31 2018 New Revision: 322804 URL: http://llvm.org/viewvc/llvm-project?rev=322804&view=rev Log: [analyzer] NFC: Remove unused method - BugReporter::RemoveUnneededCalls(). Patch by Henry Wong! Differential Revision: https://reviews.llvm.org/D42106 Modified

r323370 - [analyzer] Assume that the allocated value is non-null before construction.

2018-01-24 Thread Artem Dergachev via cfe-commits
Author: dergachev Date: Wed Jan 24 12:32:26 2018 New Revision: 323370 URL: http://llvm.org/viewvc/llvm-project?rev=323370&view=rev Log: [analyzer] Assume that the allocated value is non-null before construction. I.e. not after. In the c++-allocator-inlining=true mode, we need to make the assumpti

r323373 - [analyzer] Enable c++-allocator-inlining by default.

2018-01-24 Thread Artem Dergachev via cfe-commits
Author: dergachev Date: Wed Jan 24 12:59:40 2018 New Revision: 323373 URL: http://llvm.org/viewvc/llvm-project?rev=323373&view=rev Log: [analyzer] Enable c++-allocator-inlining by default. This allows the analyzer to analyze ("inline") custom operator new() calls and, even more importantly, inlin

r323376 - [analyzer] NFC: Run many existing C++ tests with a custom operator new().

2018-01-24 Thread Artem Dergachev via cfe-commits
Author: dergachev Date: Wed Jan 24 13:24:10 2018 New Revision: 323376 URL: http://llvm.org/viewvc/llvm-project?rev=323376&view=rev Log: [analyzer] NFC: Run many existing C++ tests with a custom operator new(). In order to provide more test coverage for inlined operator new(), add more run-lines t

r324018 - [analyzer] Don't communicate evaluation failures through memregion hierarchy.

2018-02-01 Thread Artem Dergachev via cfe-commits
Author: dergachev Date: Thu Feb 1 14:17:05 2018 New Revision: 324018 URL: http://llvm.org/viewvc/llvm-project?rev=324018&view=rev Log: [analyzer] Don't communicate evaluation failures through memregion hierarchy. We use CXXTempObjectRegion exclusively as a bailout value for construction targets

r324053 - [analyzer] Fix transitions in check::PreStmt checker callback.

2018-02-01 Thread Artem Dergachev via cfe-commits
Author: dergachev Date: Thu Feb 1 18:23:37 2018 New Revision: 324053 URL: http://llvm.org/viewvc/llvm-project?rev=324053&view=rev Log: [analyzer] Fix transitions in check::PreStmt checker callback. No in-tree checkers use this callback so far, hence no tests. But better fix this now than remembe

r324166 - [analyzer] Add a checker for mmap()s which are both writable and executable.

2018-02-02 Thread Artem Dergachev via cfe-commits
Author: dergachev Date: Fri Feb 2 18:33:42 2018 New Revision: 324166 URL: http://llvm.org/viewvc/llvm-project?rev=324166&view=rev Log: [analyzer] Add a checker for mmap()s which are both writable and executable. This is a security check which is disabled by default but will be enabled whenever t

r324167 - Revert r324166 "[analyzer] Add a checker for mmap()...".

2018-02-02 Thread Artem Dergachev via cfe-commits
Author: dergachev Date: Fri Feb 2 19:57:32 2018 New Revision: 324167 URL: http://llvm.org/viewvc/llvm-project?rev=324167&view=rev Log: Revert r324166 "[analyzer] Add a checker for mmap()...". Due to Buildbot failures - most likely that's because target triples were not specified in the tests, ev

[PATCH] D26588: Add LocationContext to members of check::RegionChanges

2016-11-14 Thread Artem Dergachev via cfe-commits
NoQ added inline comments. Comment at: include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h:735 + const FunctionDecl *FunctionDecl = SFC->getDecl()->getAsFunction(); + unsigned NumArgs = FunctionDecl->getNumParams(); + assert(ArgIdx < NumArgs && "Arg access out of ra

[PATCH] D26588: Add LocationContext to members of check::RegionChanges

2016-11-15 Thread Artem Dergachev via cfe-commits
NoQ added inline comments. Comment at: include/clang/StaticAnalyzer/Core/Checker.h:325 + const CallEvent *Call, + const LocationContext *LCtx) { +return ((const CHECKER *) checker)->checkRegionChanges(state, invalidated, -

r287045 - [analyzer] NumberObjectConversion: Workaround for a linker error with modules.

2016-11-15 Thread Artem Dergachev via cfe-commits
Author: dergachev Date: Tue Nov 15 16:22:57 2016 New Revision: 287045 URL: http://llvm.org/viewvc/llvm-project?rev=287045&view=rev Log: [analyzer] NumberObjectConversion: Workaround for a linker error with modules. A combination of C++ modules, variadic functions with more than one argument, and

[PATCH] D26762: Add a method to obtain this SVal of a method that created given StackFrameCtx

2016-11-16 Thread Artem Dergachev via cfe-commits
NoQ added a comment. I think this method, unlike https://reviews.llvm.org/D26760, doesn't have the problem with overwriting the location in the top frame, because the location of C++ "this" cannot really be assigned to. https://reviews.llvm.org/D26762 ___

[PATCH] D26760: Add the way to extract SVals of arguments used in a call for a given StackFrameCtx

2016-11-16 Thread Artem Dergachev via cfe-commits
NoQ added a comment. I'm ok with constructing `SymbolRegionValue` for `ArgLoc` manually and adding a comment like `FIXME: leaking implementation details of RegionStoreManager`. https://reviews.llvm.org/D26760 ___ cfe-commits mailing list cfe-commit

[PATCH] D26768: [analyzer] Improve VirtualCallChecker diagnostics and move out of alpha

2016-11-17 Thread Artem Dergachev via cfe-commits
NoQ accepted this revision. NoQ added a comment. This revision is now accepted and ready to land. LGTM! Comment at: test/Analysis/virtualcall.h:23 +#if INTERPROCEDURAL + // expected-warning-re@-2 ^}}Call Path : fooCall to virtual function during construction or de

[PATCH] D26588: Add LocationContext to members of check::RegionChanges

2016-11-17 Thread Artem Dergachev via cfe-commits
NoQ added inline comments. Comment at: include/clang/StaticAnalyzer/Core/Checker.h:325 + const CallEvent *Call, + const LocationContext *LCtx) { +return ((const CHECKER *) checker)->checkRegionChanges(state, invalidated, -

[PATCH] D26773: [analyzer] Refactor recursive symbol reachability check to use symbol_iterator

2016-11-17 Thread Artem Dergachev via cfe-commits
NoQ added inline comments. Comment at: lib/StaticAnalyzer/Core/ProgramState.cpp:542 +if (!visitor.VisitSymbol(*SI)) + Result = false; } I guess we should break the loop here. https://reviews.llvm.org/D26773 ___

[PATCH] D26773: [analyzer] Refactor recursive symbol reachability check to use symbol_iterator

2016-11-17 Thread Artem Dergachev via cfe-commits
NoQ added inline comments. Comment at: lib/StaticAnalyzer/Core/ProgramState.cpp:535 +if (!isa(*SI)) + continue; Hmm, the original code does actually visit non-SymbolData. https://reviews.llvm.org/D26773

[PATCH] D26836: [analyzer] SValExplainer: Support ObjC ivars and __block variables.

2016-11-17 Thread Artem Dergachev via cfe-commits
NoQ created this revision. NoQ added reviewers: zaks.anna, dcoughlin. NoQ added a subscriber: cfe-commits. This looked useful for https://reviews.llvm.org/D25909 at first, but i hesitated to rely on the explainer for composing the error messages. Still, i hope that with some work it might amount

[PATCH] D26838: [analyzer] Enforce super-region classes for various memory regions through compile-time and run-time type checks.

2016-11-17 Thread Artem Dergachev via cfe-commits
NoQ created this revision. NoQ added reviewers: zaks.anna, dcoughlin, xazax.hun, a.sidorin. NoQ added a subscriber: cfe-commits. Put a lot of compile-time and run-time checks on classes of super regions of all `SubRegion` classes, in order to maintain the existing status quo. This should make und

[PATCH] D26835: [analyzer] Minor fixes and improvements to debug.ExprInspection

2016-11-17 Thread Artem Dergachev via cfe-commits
NoQ created this revision. NoQ added reviewers: zaks.anna, dcoughlin, xazax.hun, a.sidorin. NoQ added a subscriber: cfe-commits. - Fix the bug with transition handling in `checkDeadSymbols`, that was noticed back in https://reviews.llvm.org/D18860, which never landed. - Test this bug by adding a

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

2016-11-17 Thread Artem Dergachev via cfe-commits
NoQ created this revision. NoQ added reviewers: zaks.anna, dcoughlin, xazax.hun, a.sidorin. NoQ added a subscriber: cfe-commits. Put a lot of run-time checks on how our SVals are constructed, in order to maintain the existing status quo. This should make understanding the hierarchy easier, and pr

[PATCH] D26839: [analyzer] An attempt to fix pr19539 - crashes on temporaries life-extended via members

2016-11-17 Thread Artem Dergachev via cfe-commits
NoQ created this revision. NoQ added reviewers: zaks.anna, dcoughlin, xazax.hun, a.sidorin. NoQ added subscribers: nandor, cfe-commits. 1. Re-use approach used in codegen. `MaterializeTemporaryExpr` may be positioned in a strange manner, above the member access to the temporary, which makes it a

[PATCH] D26773: [analyzer] Refactor recursive symbol reachability check to use symbol_iterator

2016-11-17 Thread Artem Dergachev via cfe-commits
NoQ added a comment. Yep, looks correct now :) https://reviews.llvm.org/D26773 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D26839: [analyzer] An attempt to fix pr19539 - crashes on temporaries life-extended via members

2016-11-18 Thread Artem Dergachev via cfe-commits
NoQ updated this revision to Diff 78478. https://reviews.llvm.org/D26839 Files: lib/StaticAnalyzer/Core/ExprEngine.cpp test/Analysis/lifetime-extension.cpp Index: test/Analysis/lifetime-extension.cpp === --- /dev/null +++ test/A

[PATCH] D26839: [analyzer] An attempt to fix pr19539 - crashes on temporaries life-extended via members

2016-11-18 Thread Artem Dergachev via cfe-commits
NoQ marked an inline comment as done. NoQ added inline comments. Comment at: test/Analysis/lifetime-extension.cpp:11 + int j[2]; + S s; + A() : i(1) { alexshap wrote: > what is the role of S in this test ? I copy-pasted this from the original bug report. The o

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

2016-11-18 Thread Artem Dergachev via cfe-commits
NoQ updated this revision to Diff 78489. NoQ marked an inline comment as done. NoQ added a comment. Remove unused expression. https://reviews.llvm.org/D26837 Files: include/clang/StaticAnalyzer/Core/PathSensitive/BasicValueFactory.h include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.

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

2016-11-18 Thread Artem Dergachev via cfe-commits
NoQ added inline comments. Comment at: lib/StaticAnalyzer/Core/MemRegion.cpp:334 void BlockCodeRegion::Profile(llvm::FoldingSetNodeID& ID) const { + locTy->getTypePtr()->isBlockPointerType(); BlockCodeRegion::ProfileRegion(ID, BD, locTy, AC, superRegion); se

[PATCH] D26845: [analyzer] Fix crash on the access to a union's region.

2016-11-18 Thread Artem Dergachev via cfe-commits
NoQ added a comment. Thanks for looking into this! It seems to be exactly the same as https://reviews.llvm.org/D26442. I was just about to commit this last one, however maybe we should actually have a more careful investigation on this issue now that we have duplicates. Repository: rL LLVM

[PATCH] D26588: Add LocationContext to members of check::RegionChanges

2016-11-18 Thread Artem Dergachev via cfe-commits
NoQ added inline comments. Comment at: include/clang/StaticAnalyzer/Core/Checker.h:325 + const CallEvent *Call, + const LocationContext *LCtx) { +return ((const CHECKER *) checker)->checkRegionChanges(state, invalidated, -

[PATCH] D26760: Add the way to extract SVals of arguments used in a call for a given StackFrameCtx

2016-11-18 Thread Artem Dergachev via cfe-commits
NoQ added a comment. Note that the uncontrolled recursion checker will not be able to test this overwrite problem, because overwriting the argument region spoils the stack frame for it. Comment at: include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h:743 +const

[PATCH] D26589: Add static analyzer checker for finding infinite recursion

2016-11-18 Thread Artem Dergachev via cfe-commits
NoQ added inline comments. Comment at: lib/StaticAnalyzer/Checkers/RecursionChecker.cpp:65 + + for (const auto *ParentLC = C.getStackFrame()->getParent(); + ParentLC != nullptr; ParentLC = ParentLC->getParent()) { Off-by-1: `C.getStackFrame()` is already t

[PATCH] D26760: Add the way to extract SVals of arguments used in a call for a given StackFrameCtx

2016-11-18 Thread Artem Dergachev via cfe-commits
NoQ added inline comments. Comment at: include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h:739 + if (SFC->inTopFrame()) { +// if we are in the top frame we don't have any arguments bound in the store +// because the call wasn't modeled in the first place. ---

r287618 - [analyzer] Fix a crash on accessing a field within a literal-initialized union.

2016-11-21 Thread Artem Dergachev via cfe-commits
Author: dergachev Date: Mon Nov 21 22:29:23 2016 New Revision: 287618 URL: http://llvm.org/viewvc/llvm-project?rev=287618&view=rev Log: [analyzer] Fix a crash on accessing a field within a literal-initialized union. Because in case of unions we currently default-bind compound values in the store,

r288257 - [analyzer] Minor fixes and improvements to debug.ExprInspection

2016-11-30 Thread Artem Dergachev via cfe-commits
Author: dergachev Date: Wed Nov 30 11:57:18 2016 New Revision: 288257 URL: http://llvm.org/viewvc/llvm-project?rev=288257&view=rev Log: [analyzer] Minor fixes and improvements to debug.ExprInspection - Fix the bug with transition handling in ExprInspectionChecker's checkDeadSymbols implementati

r288260 - [analyzer] SValExplainer: Support ObjC ivars and __block variables.

2016-11-30 Thread Artem Dergachev via cfe-commits
Author: dergachev Date: Wed Nov 30 12:26:43 2016 New Revision: 288260 URL: http://llvm.org/viewvc/llvm-project?rev=288260&view=rev Log: [analyzer] SValExplainer: Support ObjC ivars and __block variables. Additionally, explain the difference between normal and heap-based symbolic regions. Added:

r288263 - [analyzer] Construct temporary objects of correct types, destroy them properly.

2016-11-30 Thread Artem Dergachev via cfe-commits
Author: dergachev Date: Wed Nov 30 13:02:44 2016 New Revision: 288263 URL: http://llvm.org/viewvc/llvm-project?rev=288263&view=rev Log: [analyzer] Construct temporary objects of correct types, destroy them properly. When constructing a temporary object region, which represents the result of Mater

r288914 - [analyzer] pr31226: Disable CastSizeChecker in C++ because it's not quite ready.

2016-12-07 Thread Artem Dergachev via cfe-commits
Author: dergachev Date: Wed Dec 7 10:12:26 2016 New Revision: 288914 URL: http://llvm.org/viewvc/llvm-project?rev=288914&view=rev Log: [analyzer] pr31226: Disable CastSizeChecker in C++ because it's not quite ready. Avoids a crash and a related false positive. Investigation by Daniel Krupp! Mo

r288917 - [analyzer] Remove an unused enum value in RetainCountChecker.

2016-12-07 Thread Artem Dergachev via cfe-commits
Author: dergachev Date: Wed Dec 7 10:51:54 2016 New Revision: 288917 URL: http://llvm.org/viewvc/llvm-project?rev=288917&view=rev Log: [analyzer] Remove an unused enum value in RetainCountChecker. No functional change intended. Differential Revision: https://reviews.llvm.org/D27408 Modified:

r289047 - [analyzer] Add dispatch_data_create as a special case in RetainCountChecker.

2016-12-08 Thread Artem Dergachev via cfe-commits
Author: dergachev Date: Thu Dec 8 08:05:48 2016 New Revision: 289047 URL: http://llvm.org/viewvc/llvm-project?rev=289047&view=rev Log: [analyzer] Add dispatch_data_create as a special case in RetainCountChecker. This function receives a callback block. The analyzer suspects that this block may b

r289554 - [analyzer] Detect ObjC properties that are both (copy) and Mutable.

2016-12-13 Thread Artem Dergachev via cfe-commits
Author: dergachev Date: Tue Dec 13 11:19:18 2016 New Revision: 289554 URL: http://llvm.org/viewvc/llvm-project?rev=289554&view=rev Log: [analyzer] Detect ObjC properties that are both (copy) and Mutable. When an Objective-C property has a (copy) attribute, the default setter for this property per

cfe-commits@lists.llvm.org

2017-04-24 Thread Artem Dergachev via cfe-commits
Author: dergachev Date: Mon Apr 24 14:30:33 2017 New Revision: 301224 URL: http://llvm.org/viewvc/llvm-project?rev=301224&view=rev Log: [analyzer] Improve suppression for inlined defensive checks before operator &. Null dereferences are suppressed if the lvalue was constrained to 0 for the first

r301251 - [analyzer] Improve subscripting null arrays for catching null dereferences.

2017-04-24 Thread Artem Dergachev via cfe-commits
Author: dergachev Date: Mon Apr 24 15:55:07 2017 New Revision: 301251 URL: http://llvm.org/viewvc/llvm-project?rev=301251&view=rev Log: [analyzer] Improve subscripting null arrays for catching null dereferences. Array-to-pointer cast now works correctly when the pointer to the array is concrete,

r302016 - [analyzer] Fix memory error bug category capitalization.

2017-05-03 Thread Artem Dergachev via cfe-commits
Author: dergachev Date: Wed May 3 06:47:13 2017 New Revision: 302016 URL: http://llvm.org/viewvc/llvm-project?rev=302016&view=rev Log: [analyzer] Fix memory error bug category capitalization. It was written as "Memory Error" in most places and as "Memory error" in a few other places, however it

[PATCH] D25475: [analyzer] Add a new SVal to support pointer-to-member operations.

2016-10-18 Thread Artem Dergachev via cfe-commits
NoQ added inline comments. Comment at: test/Analysis/pointer-to-member.cpp:79 // FIXME: Should emit a null dereference. return obj.*member; // no-warning } kromanenkov wrote: > NoQ wrote: > > In fact, maybe dereferencing a null pointer-to-member should pro

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

2016-10-18 Thread Artem Dergachev via cfe-commits
NoQ added a subscriber: a.sidorin. NoQ added a comment. Wow, you managed to check something that could be checked without going through a hell of modeling dozens of STL methods, and probably even without stepping on poor C++ temporary object modeling in the analyzer, which sounds great. These c

[PATCH] D22968: [analyzer] A checker for macOS-specific bool- and number-like objects.

2016-10-18 Thread Artem Dergachev via cfe-commits
NoQ updated this revision to Diff 74969. NoQ added a comment. - Support conversion though function calls. - Move "if (x == 0)" to pedantic for now (too loud). https://reviews.llvm.org/D22968 Files: include/clang/StaticAnalyzer/Checkers/Checkers.td lib/StaticAnalyzer/Checkers/CMakeLists.txt

r284473 - [analyzer] Add NumberObjectConversion checker.

2016-10-18 Thread Artem Dergachev via cfe-commits
Author: dergachev Date: Tue Oct 18 06:06:28 2016 New Revision: 284473 URL: http://llvm.org/viewvc/llvm-project?rev=284473&view=rev Log: [analyzer] Add NumberObjectConversion checker. When dealing with objects that represent numbers, such as Objective-C NSNumber, the language provides little prote

[PATCH] D25727: [analyzer] Handle case of undefined values in performTrivialCopy

2016-10-18 Thread Artem Dergachev via cfe-commits
NoQ accepted this revision. NoQ added a comment. This revision is now accepted and ready to land. This seems correct. Loading from a garbage pointer should be modeled as garbage, and/or caught by a checker. `performTrivialCopy` is a high-level thingy that should be able to deal with any `SVal` i

[PATCH] D25731: [analyzer] NumberObjectConversion: Support CFNumberRef.

2016-10-18 Thread Artem Dergachev via cfe-commits
NoQ created this revision. NoQ added reviewers: zaks.anna, dcoughlin. NoQ added a subscriber: cfe-commits. `CFNumberRef`, much like `NSNumber*`, can also be accidentally mistaken for a numeric value, so it is worth it to support this type in our new `NumberObjectConversion` checker. https://re

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

2016-10-20 Thread Artem Dergachev via cfe-commits
NoQ marked 9 inline comments as done. NoQ added a comment. I thought to give it a pause to take a fresh look at how to arrange the macro-hints in the summaries. Maybe something like that: CASE ARGUMENT_CONDITION(ARG_NO(0), OutOfRange) RANGE('0', '9') RANGE('A', 'Z') RANG

[PATCH] D22374: [analyzer] Copy and move constructors - ExprEngine extended for "almost trivial" copy and move constructors

2016-10-20 Thread Artem Dergachev via cfe-commits
NoQ added a reviewer: zaks.anna. NoQ added a comment. Ping!~ Did my idea sound completely wrong to you? :) Does https://reviews.llvm.org/D25660 depend on this patch? And/or did you find another workaround? https://reviews.llvm.org/D22374 ___ cfe-c

[PATCH] D25731: [analyzer] NumberObjectConversion: Support OSNumber and CFNumberRef.

2016-10-20 Thread Artem Dergachev via cfe-commits
NoQ added a comment. Ouch, i think i forgot about `OSNumber`, including tests. Comment at: lib/StaticAnalyzer/Checkers/NumberObjectConversionChecker.cpp:111 + QualType ObjT = (IsCpp || IsObjC) + ? Obj->getType().getCanonicalType().getUnqualifiedType() +

[PATCH] D25731: [analyzer] NumberObjectConversion: Support OSNumber and CFNumberRef.

2016-10-21 Thread Artem Dergachev via cfe-commits
NoQ updated this revision to Diff 75411. NoQ marked 5 inline comments as done. NoQ added a comment. Address review comments. Add the forgotten tests. https://reviews.llvm.org/D25731 Files: lib/StaticAnalyzer/Checkers/NumberObjectConversionChecker.cpp test/Analysis/number-object-conversion.c

[PATCH] D25731: [analyzer] NumberObjectConversion: Support OSNumber and CFNumberRef.

2016-10-21 Thread Artem Dergachev via cfe-commits
NoQ marked an inline comment as done. NoQ added inline comments. Comment at: lib/StaticAnalyzer/Checkers/NumberObjectConversionChecker.cpp:149 BugReporter &BR) const { MatchFinder F; Callback CB(this, BR, AM.getAnalysisD

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

2016-10-21 Thread Artem Dergachev via cfe-commits
NoQ updated this revision to Diff 75446. NoQ added a comment. Herald added a subscriber: modocache. Update the domain-specific language for function specs/summaries. https://reviews.llvm.org/D20811 Files: include/clang/StaticAnalyzer/Checkers/Checkers.td lib/StaticAnalyzer/Checkers/CMakeLis

r284960 - [analyzer] Add StdLibraryFunctions checker.

2016-10-24 Thread Artem Dergachev via cfe-commits
Author: dergachev Date: Mon Oct 24 04:41:38 2016 New Revision: 284960 URL: http://llvm.org/viewvc/llvm-project?rev=284960&view=rev Log: [analyzer] Add StdLibraryFunctions checker. This checker does not emit reports, however it influences the analysis by providing complete summaries for, or otherw

r284969 - [analyzer] Fix an ARM buildbot after r284960.

2016-10-24 Thread Artem Dergachev via cfe-commits
Author: dergachev Date: Mon Oct 24 07:54:27 2016 New Revision: 284969 URL: http://llvm.org/viewvc/llvm-project?rev=284969&view=rev Log: [analyzer] Fix an ARM buildbot after r284960. I guess we should always specify triples in all analyzer tests, regardless. Modified: cfe/trunk/test/Analysis/

Re: r284960 - [analyzer] Add StdLibraryFunctions checker.

2016-10-24 Thread Artem Dergachev via cfe-commits
Strange, i'm not receiving any buildbot emails again. Will look through bots manually next time, that doesn't sound too hard. Pushed a hotfix in r284969. On 10/24/16 3:08 PM, Renato Golin wrote: On 24 October 2016 at 10:41, Artem Dergachev via cfe-commits wrote: Author: dergachev

[PATCH] D25731: [analyzer] NumberObjectConversion: Support OSNumber and CFNumberRef.

2016-10-24 Thread Artem Dergachev via cfe-commits
NoQ updated this revision to Diff 75586. NoQ marked an inline comment as done. NoQ added a comment. - Update warning messages. I think it's better to pattern-match for integer sizes after all when we're suggesting API, this especially looks ugly for OSNumber (which is rare). - Add tests for conv

[PATCH] D25909: [analyzer] MacOSXApiChecker: Disallow dispatch_once predicates on heap and in ivars.

2016-10-24 Thread Artem Dergachev via cfe-commits
NoQ created this revision. NoQ added reviewers: zaks.anna, dcoughlin. NoQ added a subscriber: cfe-commits. As documentation in https://developer.apple.com/reference/dispatch/dispatch_once_t says, only global or static variables should have type `dispatch_once_t`, otherwise the magic with fast m

[PATCH] D25909: [analyzer] MacOSXApiChecker: Disallow dispatch_once predicates on heap and in ivars.

2016-10-24 Thread Artem Dergachev via cfe-commits
NoQ updated this revision to Diff 75589. NoQ added a comment. Hotfix code duplication i just noticed. https://reviews.llvm.org/D25909 Files: lib/StaticAnalyzer/Checkers/MacOSXAPIChecker.cpp test/Analysis/dispatch-once.m Index: test/Analysis/dispatch-once.m

[PATCH] D25909: [analyzer] MacOSXApiChecker: Disallow dispatch_once predicates on heap and in ivars.

2016-10-24 Thread Artem Dergachev via cfe-commits
NoQ added inline comments. Comment at: lib/StaticAnalyzer/Checkers/MacOSXAPIChecker.cpp:94 + else if (isa(RS)) { +// FIXME: Presence of an IVar region has priority over this branch, because +// ObjC objects are on the heap even if the core doesn't realize this. -

[PATCH] D25731: [analyzer] NumberObjectConversion: Support OSNumber and CFNumberRef.

2016-10-24 Thread Artem Dergachev via cfe-commits
NoQ updated this revision to Diff 75612. NoQ added a comment. Do not suggest any API when we're not sure (was already advised by Anna but i missed it somehow). https://reviews.llvm.org/D25731 Files: lib/StaticAnalyzer/Checkers/NumberObjectConversionChecker.cpp test/Analysis/number-object-c

r285000 - [analyzer] Use unsigned integers to rely on well-defined overflow semantics.

2016-10-24 Thread Artem Dergachev via cfe-commits
Author: dergachev Date: Mon Oct 24 13:49:04 2016 New Revision: 285000 URL: http://llvm.org/viewvc/llvm-project?rev=285000&view=rev Log: [analyzer] Use unsigned integers to rely on well-defined overflow semantics. Found by the UBSan buildbot. Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/St

Re: r284960 - [analyzer] Add StdLibraryFunctions checker.

2016-10-24 Thread Artem Dergachev via cfe-commits
Thanks! Should get better with r285000. On 10/24/16 9:34 PM, Evgenii Stepanov wrote: This code also fails with UBSan: tools/clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:285:62: runtime error: signed integer overflow: 9223372036854775807 + 1 cannot be represented in type 'lon

[PATCH] D25940: [analyzer] LibraryFunctions: Fix errors due to different integral types and typedefs on different architectures.

2016-10-25 Thread Artem Dergachev via cfe-commits
NoQ created this revision. NoQ added reviewers: zaks.anna, dcoughlin, a.sidorin, xazax.hun. NoQ added a subscriber: cfe-commits. The mechanism for filtering out wrong functions with the same name was too aggressive to filter out eg. `int` vs. `long`, when sizes of both are equal. Such issues wer

[PATCH] D25909: [analyzer] MacOSXApiChecker: Disallow dispatch_once predicates on heap and in ivars.

2016-10-25 Thread Artem Dergachev via cfe-commits
NoQ added inline comments. Comment at: test/Analysis/dispatch-once.m:13 + +void test_stack() { + dispatch_once_t once; dcoughlin wrote: > Should the tests for dispatch_once in unix-fns.c be moved here? In fact we need to de-duplicate code with unix.API's pthread

[PATCH] D25909: [analyzer] MacOSXApiChecker: Disallow dispatch_once predicates on heap and in ivars.

2016-10-25 Thread Artem Dergachev via cfe-commits
NoQ updated this revision to Diff 75739. NoQ marked 2 inline comments as done. NoQ added a comment. Consider a lot more dispatch_once_t regions: improve diagnostics for local structs containing predicates, find ivar structs with predicates. Address a couple of review comments, discuss the rest.

[PATCH] D25876: [analyzer] Report CFNumberGetValue API misuse

2016-10-25 Thread Artem Dergachev via cfe-commits
NoQ added inline comments. Comment at: test/Analysis/CFNumber.c:39 + unsigned char scalar = 0; + CFNumberGetValue(x, kCFNumberSInt16Type, &scalar); // expected-warning{{A CFNumber object that represents a 16-bit integer is used to initialize an 8-bit integer; 8 bits of the C

[PATCH] D25909: [analyzer] MacOSXApiChecker: Disallow dispatch_once predicates on heap and in ivars.

2016-10-27 Thread Artem Dergachev via cfe-commits
NoQ updated this revision to Diff 75998. NoQ marked 3 inline comments as done. NoQ added a comment. Also, do not create error nodes unless we're sure we're throwing a report. https://reviews.llvm.org/D25909 Files: lib/StaticAnalyzer/Checkers/MacOSXAPIChecker.cpp lib/StaticAnalyzer/Core/Simp

[PATCH] D25909: [analyzer] MacOSXApiChecker: Disallow dispatch_once predicates on heap and in ivars.

2016-10-27 Thread Artem Dergachev via cfe-commits
NoQ added inline comments. Comment at: test/Analysis/dispatch-once.m:62 +- (void)test_ivar_struct_from_inside { + dispatch_once(&s.once, ^{}); // expected-warning{{Call to 'dispatch_once' uses the instance variable 's' for the predicate value.}} +} dcoughlin wr

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

2016-10-27 Thread Artem Dergachev via cfe-commits
NoQ added a comment. Thanks!! Will try to look at the rest of the stuff as soon as possible>< Comment at: test/Analysis/iterator-past-end.cpp:3 + +template struct __iterator { + typedef __iterator iterator; baloghadamsoftware wrote: > NoQ wrote: > > We should

[PATCH] D25940: [analyzer] LibraryFunctions: Fix errors due to different integral types and typedefs on different architectures.

2016-10-27 Thread Artem Dergachev via cfe-commits
NoQ updated this revision to Diff 76031. NoQ marked 2 inline comments as done. NoQ added a comment. In https://reviews.llvm.org/D25940#579227, @dcoughlin wrote: > Are the parameter types actually needed? I think in general the rest of the > analyzer uses arity alone. Arity checks are to avoid

[PATCH] D26030: Add shebang.

2016-10-27 Thread Artem Dergachev via cfe-commits
NoQ accepted this revision. NoQ added a comment. This revision is now accepted and ready to land. These scripts aren't `+x`. Maybe you want to make them executable as well. Also, scan-build-py adds `# -*- coding: utf-8 -*-` as well to its python executables. Repository: rL LLVM https://revie

[PATCH] D25731: [analyzer] NumberObjectConversion: Support OSNumber and CFNumberRef.

2016-10-27 Thread Artem Dergachev via cfe-commits
NoQ updated this revision to Diff 76043. NoQ added a comment. - Fix warning messages, finally, hopefully. - Make handling of macros much more careful, because errors of form `x == Y`, where X is an `NSNumber` pointer, and `Y` is a custom macro that expands to `0`, were found. https://reviews.l

r285533 - [analyzer] NumberObjectConversion: support more types, misc updates.

2016-10-30 Thread Artem Dergachev via cfe-commits
Author: dergachev Date: Sun Oct 30 22:08:48 2016 New Revision: 285533 URL: http://llvm.org/viewvc/llvm-project?rev=285533&view=rev Log: [analyzer] NumberObjectConversion: support more types, misc updates. Support CFNumberRef and OSNumber objects, which may also be accidentally converted to plain

r285605 - [analyzer] MacOSXAPIChecker: Disallow dispatch_once_t in ivars and heap.

2016-10-31 Thread Artem Dergachev via cfe-commits
Author: dergachev Date: Mon Oct 31 12:27:26 2016 New Revision: 285605 URL: http://llvm.org/viewvc/llvm-project?rev=285605&view=rev Log: [analyzer] MacOSXAPIChecker: Disallow dispatch_once_t in ivars and heap. Unlike global/static variables, calloc etc. functions that allocate ObjC objects behave

[PATCH] D26159: [analyzer] MacOSXAPIChecker: Improve warning messages for __block vars in dispatch_once().

2016-10-31 Thread Artem Dergachev via cfe-commits
NoQ created this revision. NoQ added reviewers: zaks.anna, dcoughlin. NoQ added a subscriber: cfe-commits. The checker already warns for `__block`-storage variables being used as a `dispatch_once()` predicate, however it refers to them as local which is not quite accurate, so we fix that. Also

[PATCH] D26159: [analyzer] MacOSXAPIChecker: Improve warning messages for __block vars in dispatch_once().

2016-10-31 Thread Artem Dergachev via cfe-commits
NoQ added a comment. > FIXME: The analyzer sets stack memory space for __block variables when they > are referenced outside the block (eg. test_block_var_from_outside_block() > line 108). Will try to fix in a separate patch; i'm not relying on the memory > space in this patch. That's actually

r285637 - [analyzer] MacOSXAPIChecker: Improve warnings for __block vars in dispatch_once.

2016-10-31 Thread Artem Dergachev via cfe-commits
Author: dergachev Date: Mon Oct 31 16:04:54 2016 New Revision: 285637 URL: http://llvm.org/viewvc/llvm-project?rev=285637&view=rev Log: [analyzer] MacOSXAPIChecker: Improve warnings for __block vars in dispatch_once. The checker already warns for __block-storage variables being used as a dispatch

r285640 - [analyzer] Allow undefined values in performTrivialCopy.

2016-10-31 Thread Artem Dergachev via cfe-commits
Author: dergachev Date: Mon Oct 31 16:11:20 2016 New Revision: 285640 URL: http://llvm.org/viewvc/llvm-project?rev=285640&view=rev Log: [analyzer] Allow undefined values in performTrivialCopy. Reading from a garbage pointer should be modeled as garbage, and performTrivialCopy should be able to de

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

2016-11-01 Thread Artem Dergachev via cfe-commits
NoQ added a comment. I think i managed to understand the reasoning behind your solutions! Right now i definitely approve all the high-level logic apart from the handling of left/right `SVal`s for `evalAssume`, which i think could be easily improved upon without significant drawbacks. See the in

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

2016-11-01 Thread Artem Dergachev via cfe-commits
NoQ added inline comments. Comment at: lib/StaticAnalyzer/Checkers/IteratorPastEndChecker.cpp:580 + C.addTransition(stateFound); + C.addTransition(stateNotFound); +} Ouch, i have one more concern, which can be expressed with the following false-positive test w

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

2016-11-01 Thread Artem Dergachev via cfe-commits
NoQ added inline comments. Comment at: lib/StaticAnalyzer/Checkers/IteratorPastEndChecker.cpp:580 + C.addTransition(stateFound); + C.addTransition(stateNotFound); +} NoQ wrote: > Ouch, i have one more concern, which can be expressed with the following > false-

[PATCH] D25940: [analyzer] LibraryFunctions: Fix errors due to different integral types and typedefs on different architectures.

2016-11-01 Thread Artem Dergachev via cfe-commits
NoQ updated this revision to Diff 76641. NoQ added a comment. Try out a completely different approach which was also suggested by Anna. Allow providing multiple variants of summaries for each function identifier, with different type specifications and branches. This way we preserve type checks

[PATCH] D19979: [analyzer] ScopeContext - initial implementation

2016-11-02 Thread Artem Dergachev via cfe-commits
NoQ added a comment. https://llvm.org/bugs/show_bug.cgi?id=28450 ^Another impressing test case for variable scopes, which should ideally be fixed by scope contexts, even though i doubt this patch (or the CFG patch) addresses this issue. Variable-length arrays might actually mess up things quite

[PATCH] D25940: [analyzer] LibraryFunctions: Fix errors due to different integral types and typedefs on different architectures.

2016-11-02 Thread Artem Dergachev via cfe-commits
NoQ updated this revision to Diff 76731. NoQ added a comment. Comment up on variants. https://reviews.llvm.org/D25940 Files: lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp test/Analysis/std-c-library-functions.c Index: test/Analysis/std-c-library-functions.c ===

r285852 - [analyzer] StdLibraryFunctions: provide platform-specific function summaries.

2016-11-02 Thread Artem Dergachev via cfe-commits
Author: dergachev Date: Wed Nov 2 14:35:20 2016 New Revision: 285852 URL: http://llvm.org/viewvc/llvm-project?rev=285852&view=rev Log: [analyzer] StdLibraryFunctions: provide platform-specific function summaries. Because standard functions can be defined differently on different platforms, this

[PATCH] D26342: [analyzer] Add MutexChecker for the Magenta kernel

2016-11-07 Thread Artem Dergachev via cfe-commits
NoQ added a comment. It's great to see more domain-specific checks coming in! We're glad to be useful. The code is also well-commented, and a lot of tests are provided, which is great. This checker seems to be relatively similar to the existing `alpha.unix.PthreadLock` checker (which also hand

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

2016-11-09 Thread Artem Dergachev via cfe-commits
NoQ added a comment. Sorry for inactivity, been thinking quite a bit about this checker. The checker is very cool because it is an excellent showcase of our API problems in the realm of C++ checkers. Once the checker is committed, we could try various things to make it easier to develop other c

<    3   4   5   6   7   8   9   10   11   12   >