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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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,
-
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
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
___
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
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
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,
-
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
___
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
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
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
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
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
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
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
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
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
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.
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
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
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,
-
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
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
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.
---
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,
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
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:
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
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
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:
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
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
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
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,
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
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
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
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
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
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
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
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
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
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()
+
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
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
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
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
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/
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
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
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
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
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.
-
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
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
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
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
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
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.
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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-
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
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
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
===
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
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
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
701 - 800 of 1257 matches
Mail list logo