| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
to addition.
We should not to warn in case the malloc size argument is an
addition containing 'sizeof' operator - it is common to use the pattern
to pack values of different sizes into a buffer.
Ex:
uint8_t *buffer = (uint8_t*)malloc(dataSize + sizeof(length));
llvm-svn: 158219
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
CmpRuns.py can be used to compare issues from different analyzer runs.
Since it uses the issue line number to unique 2 issues, adding a new
line to the beginning of a file makes all issues in the file reported as
new.
The hash will be an opaque value which could be used (along with the
function name) by CmpRuns to identify the same issues. This way, we only
fail to identify the same issue from two runs if the function it appears
in changes (not perfect, but much better than nothing).
llvm-svn: 158180
|
|
|
|
|
|
|
|
|
| |
I falsely assumed that the memory spaces are equal when we reach this
point, they might not be when memory space of one or more is stack or
Unknown. We don't want a region from Heap space alias something with
another memory space.
llvm-svn: 158165
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add a concept of symbolic memory region belonging to heap memory space.
When comparing symbolic regions allocated on the heap, assume that they
do not alias.
Use symbolic heap region to suppress a common false positive pattern in
the malloc checker, in code that relies on malloc not returning the
memory aliased to other malloc allocations, stack.
llvm-svn: 158136
|
|
|
|
|
|
| |
Patch by Guillem Marpons!
llvm-svn: 158106
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
value_type
In addition, I've made the pointer and reference typedef 'void' rather than T*
just so they can't get misused. I would've omitted them entirely but
std::distance likes them to be there even if it doesn't use them.
This rolls back r155808 and r155869.
Review by Doug Gregor incorporating feedback from Chandler Carruth.
llvm-svn: 158104
|
|
|
|
|
|
| |
-Wunused-private-field.
llvm-svn: 158086
|
|
|
|
|
|
|
|
| |
to see more of the path
to discover how a value was used uninitialized.
llvm-svn: 158048
|
|
|
|
|
|
|
|
| |
locations, forcing
adjacent edges to have compatible ranges. This simplifies the layout logic for some clients.
llvm-svn: 158028
|
|
|
|
|
|
|
| |
This bug was triggered by r157851. It only happens in the case where we
don't perform optimal diagnostic pruning.
llvm-svn: 157950
|
|
|
|
| |
llvm-svn: 157886
|
|
|
|
|
|
|
|
| |
explicitly.
This will make it easier to add inlining support to more expressions.
llvm-svn: 157870
|
|
|
|
|
|
|
|
|
|
|
|
| |
When we timeout or exceed a max number of blocks within an inlined
function, we retry with no inlining starting from a node right before
the CallEnter node. We assume the state of that node is the state of the
program before we start evaluating the call. However, the node pruning
removes this node as unimportant.
Teach the node pruning to keep the predecessors of the call enter nodes.
llvm-svn: 157860
|
|
|
|
|
|
|
| |
We should not stop exploring the path after we return from an empty
function.
llvm-svn: 157859
|
|
|
|
| |
llvm-svn: 157851
|
|
|
|
| |
llvm-svn: 157833
|
|
|
|
| |
llvm-svn: 157772
|
|
|
|
|
|
|
|
|
|
| |
We should lock the number of elements after the initial parsing is
complete. Recursive AST visitors in AnalyzesConsumer and CallGarph can
trigger lazy pch deserialization resulting in more calls to
HandleTopLevelDecl and appending to the LocalTUDecls list. We should
ignore those.
llvm-svn: 157762
|
|
|
|
|
|
|
|
|
| |
we have significantly
improved the pruning heuristics. The current heuristics are pretty good, but they make diagnostics
for uninitialized variables warnings particularly useless in some cases.
llvm-svn: 157734
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Follow up in r155693, r155680.
Prevents a hard to reproduce crash with the following stack trace:
3 libsystem_c.dylib 0x00007ff55a835050 _sigtramp + 18446744029881443184
4 clang 0x0000000106218e97 (anonymous
namespace)::AnalysisConsumer::HandleTranslationUnit(clang::ASTContext&)
+ 519
5 clang 0x0000000105cf3002 clang::ParseAST(clang::Sema&,
bool, bool) + 690
6 clang 0x00000001059a41d8
clang::ASTFrontendAction::ExecuteAction() + 312
7 clang 0x00000001059a3df7 clang::FrontendAction::Execute()
+ 231
8 clang 0x00000001059b0ecc
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 860
9 clang 0x000000010595e451
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 961
10 clang 0x0000000105947f29 cc1_main(char const**, char
const**, char const*, void*) + 969
11 clang 0x0000000105958259 main + 473
12 clang 0x0000000105947b34 start + 52
llvm-svn: 157721
|
|
|
|
| |
llvm-svn: 157531
|
|
|
|
| |
llvm-svn: 157478
|
|
|
|
| |
llvm-svn: 157402
|
|
|
|
|
|
|
|
| |
pointer.
Fixes one of the crashes reported in PR12874.
llvm-svn: 157401
|
|
|
|
|
|
| |
(ex: float).
llvm-svn: 157211
|
|
|
|
|
|
| |
While there clean up indentation.
llvm-svn: 157204
|
|
|
|
| |
llvm-svn: 157088
|
|
|
|
| |
llvm-svn: 157082
|
|
|
|
| |
llvm-svn: 157081
|
|
|
|
|
|
| |
allocating functions.
llvm-svn: 157037
|
|
|
|
|
|
|
|
|
|
| |
The new debug.ExprInspection checker looks for calls to clang_analyzer_eval,
and emits a warning of TRUE, FALSE, or UNKNOWN (or UNDEFINED) based on the
constrained value of its (boolean) argument. It does not modify the analysis
state though the conditions tested can result in branches (e.g. through the
use of short-circuit operators).
llvm-svn: 156919
|
|
|
|
|
|
|
| |
We can no longer rely on children iterator to visit all the AST
tree children of an expression (OpaqueValueExpr has no children).
llvm-svn: 156870
|
|
|
|
|
|
|
|
|
|
| |
We check the address of the last element accessed, but with 0 calculating that
address results in element -1. This patch bails out early (and avoids a bunch
of other work at that).
Fixes PR12807.
llvm-svn: 156769
|
|
|
|
| |
llvm-svn: 156699
|
|
|
|
| |
llvm-svn: 156661
|
|
|
|
|
|
|
|
| |
file buffer, not at the start of lexing.
Fixes assertion hit in format diagnostics. rdar://11418366
llvm-svn: 156647
|
|
|
|
| |
llvm-svn: 156582
|
|
|
|
|
|
|
|
|
|
|
|
| |
(b) had
a horrible bug in GetLazyBindings where we falsely appended a field suffix when traversing 3 or more
layers of lazy bindings. I don't have a reduced test case yet; but I have added the original source
to an internal regression test suite. I'll see about coming up with a reduced test case.
Fixes <rdar://problem/11405978> (for real).
llvm-svn: 156580
|
|
|
|
|
|
|
|
|
|
|
| |
to reason about.
As part of taint propagation, we now allow creation of non-integer
symbolic expressions like a cast from int to float.
Addresses PR12511 (radar://11215362).
llvm-svn: 156578
|
|
|
|
|
|
|
|
|
|
| |
We report a leak at a point a leaked variable is no longer accessible.
The statement that happens to be at that point is not relevant to the
leak diagnostic and, thus, should not be highlighted.
radar://11178519
llvm-svn: 156530
|
|
|
|
| |
llvm-svn: 156482
|
|
|
|
| |
llvm-svn: 156481
|
|
|
|
|
|
|
|
|
|
|
|
| |
RegionStore, so be explicit about it and generate UnknownVal().
This is a hack to ensure we never produce undefined values for a value
coming from a compound value. (The undefined values can lead to
false positives.)
radar://10127782
llvm-svn: 156446
|
|
|
|
|
|
|
|
|
| |
ElementRegions. This is a bit
disruptive, but it allows RegionStore to better "see" through casts that reinterpret arrays of values
as structs. Fixes <rdar://problem/11405978>.
llvm-svn: 156428
|
|
|
|
|
|
|
|
| |
instead of creating new ones.
This is a functionality optimization.
llvm-svn: 156427
|
|
|
|
| |
llvm-svn: 156426
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
don't reason about.
Self is just like a local variable in init methods, so it can be
assigned anything like result of static functions, other methods ... So
to suppress false positives that result in such cases, stop tracking the
checker-specific state after self is being assigned to (unless the
value is't being assigned to is either self or conforms to our rules).
This change does not invalidate any existing regression tests.
llvm-svn: 156420
|
|
|
|
| |
llvm-svn: 156369
|
|
|
|
|
|
|
| |
This could conceivably cut down on state proliferation, although we don't
use BasicConstraintManager by default anymore. No functionality change.
llvm-svn: 156362
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This involves keeping track of three separate types: the symbol type, the
adjustment type, and the comparison type. For example, in "$x + 5 > 0ULL",
if the type of $x is 'signed char', the adjustment type is 'int' and the
comparison type is 'unsigned long long'. Most of the time these three types
will be the same, but we should still do the right thing when the
comparison value is out of range, and wraparound should be calculated in
the adjustment type.
This also re-disables an out-of-bounds test; we were extracting the symbol
from non-additive SymIntExprs, but then throwing away the integer.
Sorry for the large patch; both the basic and range constraint managers needed
to be updated together, since they share code in SimpleConstraintManager.
llvm-svn: 156361
|