| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| |
|
|
|
|
|
|
|
| |
to a flag (-analyzer-check-idempotent-operations)
- Added IdempotentOperationChecker to experimental analyses for testing purposes
- Updated test cases to explictly call the checker
llvm-svn: 110482
|
| |
|
|
| |
llvm-svn: 110408
|
| |
|
|
|
|
| |
valid Loc. Fixes PR7830.
llvm-svn: 110390
|
| |
|
|
|
|
| |
sometimes allow for multiple sequential statements to be flagged.
llvm-svn: 110353
|
| |
|
|
|
|
| |
analyzer. Fixes a crash reported in <rdar://problem/8272168>. Patch by Henry Mason!
llvm-svn: 110289
|
| |
|
|
|
|
| |
convert values to an lvalue. This allows us to warn (again) about returning references to stack variables. (fixes PR 7812).
llvm-svn: 110242
|
| |
|
|
|
|
|
|
| |
invalidated in function
calls when the enclosing object had retain/release state. Fixes <rdar://problem/8261992>.
llvm-svn: 110068
|
| |
|
|
| |
llvm-svn: 110058
|
| |
|
|
|
|
|
|
| |
the top-level object. FlatStore now can bind and retrieve element and field
regions.
PR7297 is fixed by flat store.
llvm-svn: 110020
|
| |
|
|
|
|
|
|
|
|
| |
a switch or goto somewhere in the function. Indirect gotos trigger the
jump-checker regardless, because the conditions there are slightly more
elaborate and it's too marginal a case to be worth optimizing.
Turns off the jump-checker in a lot of cases in C++. rdar://problem/7702918
llvm-svn: 109962
|
| |
|
|
|
|
| |
for malloc/free checking. Patch by Andrew McGregor!
llvm-svn: 109939
|
| |
|
|
| |
llvm-svn: 109895
|
| |
|
|
| |
llvm-svn: 109736
|
| |
|
|
|
|
| |
than copying each character.
llvm-svn: 109734
|
| |
|
|
|
|
| |
and CharacterLiteral. Fixes an assertion failure reported in PR 7675.
llvm-svn: 109719
|
| |
|
|
|
|
| |
fixes a false path issue reported in <rdar://problem/8243408> and also spurs another cause where the idempotent operations checker fires.
llvm-svn: 109710
|
| |
|
|
|
|
|
|
|
| |
- Allowed reporting of dead macros
- Added path walking function to search for false positives in conditional statements
- Updated some affected tests
- Added some false positive test cases
llvm-svn: 109561
|
| |
|
|
|
|
| |
binary operator for clearer error reporting. Also remove the 'Idempotent operation' prefix in messages; it's redundant since the bug type is the same.
llvm-svn: 109527
|
| |
|
|
|
|
|
|
| |
__builtin_unreachable().
The next step is to warn if a block labeled unreachable is, in fact, reachable. Somewhat related to PR810.
llvm-svn: 109487
|
| |
|
|
|
|
| |
of constant string literals, which is not too helpful, and only calls to strlen() are checked.
llvm-svn: 109480
|
| |
|
|
|
|
|
|
|
|
| |
analyzer checks.
- Created a new class to do post-analysis
- Updated several test cases with unreachable code to expect a warning
- Added some general tests
llvm-svn: 109286
|
| |
|
|
| |
llvm-svn: 109225
|
| |
|
|
| |
llvm-svn: 109106
|
| |
|
|
| |
llvm-svn: 108671
|
| |
|
|
| |
llvm-svn: 108669
|
| |
|
|
|
|
| |
removing a bogus assertion.
llvm-svn: 108602
|
| |
|
|
|
|
| |
an APFloat with different "float semantics" than the compared float literal.
llvm-svn: 108590
|
| |
|
|
|
|
|
|
|
|
| |
it into the default path-sensitive analysis options.
- Added checks for static local variables, self assigned parameters, and truncating/extending self assignments
- Removed command line option (now default with --analyze)
- Updated test cases to pass with idempotent operation warnings
llvm-svn: 108550
|
| |
|
|
|
|
|
|
|
|
| |
int test1() {
return;
}
default to an error.
llvm-svn: 108108
|
| |
|
|
|
|
| |
zero/nonzero sizes.
llvm-svn: 107935
|
| |
|
|
|
|
| |
the buffer arguments and have a special-case for when the buffer arguments are known to be the same address, or when the size is zero.
llvm-svn: 107761
|
| |
|
|
|
|
| |
arguments...which are allowed if the access length is 0!
llvm-svn: 107759
|
| |
|
|
|
|
|
|
| |
people seem to write when they want a deterministic trap.
Suggest instead that they use a volatile pointer or
__builtin_trap.
llvm-svn: 107756
|
| |
|
|
| |
llvm-svn: 107735
|
| |
|
|
|
|
| |
null-terminated strings and memory blocks. Currently only checks memcpy(), memmove(), and bcopy(), but this is intended to be expanded soon.
llvm-svn: 107722
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(-analyzer-idempotent-operation). Finds idempotent and/or tautological operations in a path sensitive context, flagging operations that have no effect or a predictable effect.
Example:
{
int a = 1;
int b = 5;
int c = b / a; // a is 1 on all paths
}
- New IdempotentOperationChecker class
- Moved recursive Stmt functions in r107675 to IdempotentOperationChecker
- Minor refactoring of SVal to allow checking for any integer
- Added command line option for check
- Added basic test cases
llvm-svn: 107706
|
| |
|
|
| |
llvm-svn: 107634
|
| |
|
|
|
|
| |
argument was non-NULL, and we report where the null assumption came from (like AttrNonNullChecker already did).
llvm-svn: 107633
|
| |
|
|
|
|
| |
unimplemented. A VLA region's sizeof value matches its extent.
llvm-svn: 107611
|
| |
|
|
| |
llvm-svn: 107603
|
| |
|
|
|
|
|
|
|
|
| |
regions that may not be known at compile-time (such as those created by malloc). This replaces the old setExtent/getExtent API on Store, which used the GRState's GDM to store SVals.
Also adds a getKnownValue() method to SValuator, which gets the integer value of an SVal if it is known to only have one possible value. There are more places in the code that could be using this, but in general we want to be dealing entirely in SVals, so its usefulness is limited.
The only visible functionality change is that extents are now honored for any DeclRegion, such as fields and Objective-C ivars, rather than just variables. This shows up in bounds-checking and cast-size-checking.
llvm-svn: 107577
|
| |
|
|
|
|
|
|
|
|
|
| |
non-static global variables
when calling a function/method whose impact on global variables we cannot accurately estimate.
This change introduces two new MemSpaceRegions that divide up the memory space of globals, and causes
RegionStore and BasicStore to consult a binding to the NonStaticGlobalsMemSpaceRegion when lazily
determining the value of a global.
llvm-svn: 107423
|
| |
|
|
|
|
|
|
|
|
| |
As a bonus, fix the warning for || and && operators; it was emitted even if one of the operands had side effects, e.g:
x || test_logical_foo1();
emitted a bogus "expression result unused" for 'x'.
llvm-svn: 107274
|
| |
|
|
|
|
| |
don't crash if we do a funny thing like ((int)ptr)&1. Fixes PR7527.
llvm-svn: 107236
|
| |
|
|
|
|
| |
SimpleSValuator::EvalBinOpLL().
llvm-svn: 106992
|
| |
|
|
|
|
| |
constraints. Part of PR7491.
llvm-svn: 106972
|
| |
|
|
|
|
| |
scaled as well.
llvm-svn: 106911
|
| |
|
|
|
|
| |
invalid source range for CXXNewExpr.
llvm-svn: 106904
|
| |
|
|
|
|
| |
regression test.
llvm-svn: 106883
|
| |
|
|
|
|
| |
Lexer/hexfloat.cpp is now XFAIL'd, I'd appreciate if someone could look into it.
llvm-svn: 106840
|