| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
| |
* Add a load type to GRExprEngine::EvalLoad().
* When retrieve from 'theValue' of OSAtomic funcitions, use the type of the
region instead of the argument expression as the load type.
* Then we can convert CastRetrievedSVal to a pure assertion. In the future
we can let all Retrieve() methods simply return SVal.
llvm-svn: 88888
|
|
|
|
| |
llvm-svn: 86932
|
|
|
|
|
|
| |
getBaseRegion will be used in another method.
llvm-svn: 86649
|
|
|
|
|
|
| |
Patch by Victor Zverovich!
llvm-svn: 86638
|
|
|
|
|
|
|
| |
ArrayType>()) does not instantiate. Update all callers that used this
unsafe feature to use the appropriate ASTContext::getAs*ArrayType method.
llvm-svn: 86596
|
|
|
|
|
|
| |
VarDecl*, and modify GRExprEngine::EvalBind() to handle decl initialization as well. This paves the way for adding "checker" visitation in EvalBind().
llvm-svn: 85983
|
|
|
|
|
|
|
|
| |
by Zhongxing Xu. RemoveDeadBindings() would falsely prune
SymbolicRegions from the store that wrapped derived symbols whose
liveness could only be determined after scanning the store.
llvm-svn: 85484
|
|
|
|
|
|
|
|
|
|
| |
an Objective-C object
region when doing lazy value retrieval of an ivar.
This fixes: <rdar://problem/7312221>
llvm-svn: 84584
|
|
|
|
| |
llvm-svn: 84398
|
|
|
|
|
|
| |
nothing) and into RemoveDeadBindings. No functionality change.
llvm-svn: 84335
|
|
|
|
|
|
|
| |
the code to standard worklist algorithm. Always add both sub and super
regions of live regions.
llvm-svn: 84323
|
|
|
|
|
|
| |
kinds. This means we are visiting all regions 'from super region'.
llvm-svn: 84319
|
|
|
|
|
|
|
|
| |
touched by StoreManager::InvalidateRegion().
This fixes <rdar://problem/7257223> and <rdar://problem/7283470>.
llvm-svn: 84223
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
RegionStoreManager::Retrieve() that was intended to handle conflated uses of pointers as integers.
It turns out this isn't needed, and resulted in inconsistent behavior when creating symbolic values on the following test case in 'tests/Analysis/misc-ps.m':
typedef struct _BStruct { void *grue; } BStruct;
void testB_aux(void *ptr);
void testB(BStruct *b) {
{
int *__gruep__ = ((int *)&((b)->grue));
int __gruev__ = *__gruep__;
testB_aux(__gruep__);
}
{
int *__gruep__ = ((int *)&((b)->grue));
int __gruev__ = *__gruep__;
if (~0 != __gruev__) {}
}
}
When the code was analyzed with '-arch x86_64', the value assigned to '__gruev__' be would be a
symbolic integer, but for '-arch i386' the value assigned to '__gruev__' would be a symbolic region
(a blob of memory). With this change the value created is always a symbolic integer.
Since the code being removed was added to support analysis of code calling
OSAtomicCompareAndSwapXXX(), I also modified 'test/Analysis/NSString.m' to analyze the code in both
'-arch i386' and '-arch x86_64', and also added some complementary test cases to test the presence
of leaks when using OSAtomicCompareAndSwap32Barrier()/OSAtomicCompareAndSwap64Barrier() instead of
just their absence. This code change reveals that previously both RegionStore and BasicStore were
handling these cases wrong, and would never cause the analyzer to emit a leak in these cases (false
negatives). Now RegionStore gets it right, but BasicStore still gets it wrong (and hence it has been
disabled temporarily for this test case).
llvm-svn: 84163
|
|
|
|
|
|
| |
* Make all Base value the last argument.
llvm-svn: 84071
|
|
|
|
| |
llvm-svn: 83934
|
|
|
|
|
|
|
|
| |
default binding for regions. This allows us to simply a lot of code. A
further simplification could be done is that many methods of
regionstore can only work on Store instead of GRState.
llvm-svn: 83762
|
|
|
|
| |
llvm-svn: 83611
|
|
|
|
| |
llvm-svn: 83610
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
adding assert
This fix required a few changes:
SimpleSValuator:
- Eagerly replace a symbolic value with its constant value in EvalBinOpNN
when it is constrained to a constant. This allows us to better constant fold
values along a path.
- Handle trivial case of '<', '>' comparison of pointers when the two pointers
are exactly the same.
RegionStoreManager:
llvm-svn: 83358
|
|
|
|
|
|
|
|
|
| |
concrete types. Use unqualified desugaring for getAs<> and sundry.
Fix a few users to either not desugar or use qualified desugar, as seemed
appropriate. Removed Type's qualified desugar method, as it was easy
to accidentally use instead of QualType's.
llvm-svn: 83116
|
|
|
|
|
|
|
|
| |
'*((unsigned int *)"????")'
This issue was originally reported via personal email by Thomas Clement!
llvm-svn: 83069
|
|
|
|
|
|
|
|
|
|
| |
identified with a false positive reported by Thomas Clement. This
involved doing another rewrite of
RegionStoreManager::RemoveDeadBindings(), which phrases the entire
problem of scanning for dead regions as a graph exploration problem.
It is more methodic than the previous implementation.
llvm-svn: 83053
|
|
|
|
|
|
|
|
|
| |
are only specially treated by RegionStore::InvalidateRegion() when
their super region is also invalidated. When this isn't the case,
conjure a new symbol for a FieldRegion. Thanks to Zhongxing Xu and
Daniel Dunbar for pointing out this issue.
llvm-svn: 83043
|
|
|
|
|
|
| |
region has also been invalidated.
llvm-svn: 83040
|
|
|
|
|
|
|
| |
RegionStoreManager::InvalidateRegion() by only removing their old
binding, not conjuring a new symbol.
llvm-svn: 82939
|
|
|
|
| |
llvm-svn: 82924
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
<rdar://problem/6914474> checker doesn't realize that variable might
have been assigned if a pointer to that variable was passed to another
function via a structure
The problem here was the RegionStoreManager::InvalidateRegion didn't
invalidate the bindings of invalidated regions. This required a
rewrite of this method using a worklist.
As part of this fix, changed ValueManager::getConjuredSymbolVal() to
require a 'void*' SymbolTag argument. This tag is used to
differentiate two different symbols created at the same location.
llvm-svn: 82920
|
|
|
|
|
|
| |
instead of 'cast<PointerType>()' (to handle pointer typedefs).
llvm-svn: 82686
|
|
|
|
|
|
|
|
|
|
| |
parameter regions
The issue was a discrepancy between how RegionStoreManager::Bind() and
RegionStoreManager::Retrieve() derived the "key" for the first element
of a symbolic region.
llvm-svn: 82680
|
|
|
|
|
|
| |
floats not honored
llvm-svn: 82575
|
|
|
|
|
|
|
|
|
|
|
| |
Several of the existing methods were identical to their respective
specializations, and so have been removed entirely. Several more 'leaf'
optimizations were introduced.
The getAsFoo() methods which imposed extra conditions, like
getAsObjCInterfacePointerType(), have been left in place.
llvm-svn: 82501
|
|
|
|
|
|
|
|
| |
integer pointer. For now just invalidate the fields of the struct.
This addresses: <rdar://problem/7185607> [RegionStore] support invalidation of bit fields using integer assignment
llvm-svn: 82492
|
|
|
|
| |
llvm-svn: 81346
|
|
|
|
| |
llvm-svn: 81092
|
|
|
|
|
|
| |
when using the non-fragile Objective-C ABI. This fixes <rdar://problem/7168531>.
llvm-svn: 80047
|
|
|
|
|
|
|
| |
implicit cast logic in RegionStoreManager to BasicStoreManager. This involved
moving CastRetriedVal from RegionStoreManager to StoreManager.
llvm-svn: 80026
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
SelfRegion represented the object bound to 'self' (when analyzing Objective-C
methods) upon entry to a method. Having this region stored on the side ignores
the current stack frame that we might be analyzing (among other things), and is
a problem for interprocedural analysis.
For RegionStoreManager, the value for SelfRegion is just lazily created.
For BasicStoreManager, the value for SelfRegion is bound eagerly to 'self', but
no explicit tracking of SelfRegion on the side is made.
As part of this change, remove the restriction in BasicStoreManager that we only
track ivars for 'self'. This shouldn't actually change anything in terms of
precision, and simplifies the logic.
llvm-svn: 79694
|
|
|
|
|
|
| |
analysis.
llvm-svn: 79680
|
|
|
|
|
|
| |
GRStateManager to create the SelfRegion.
llvm-svn: 79628
|
|
|
|
|
|
|
| |
of GRStateManager and GRExprEngine, pass the initial location context
to the getInitialState() method.
llvm-svn: 79228
|
|
|
|
|
|
|
| |
with array accesses. In the process, refactor some common logic in
RetrieveElement() and RetrieveField() into RetrieveFieldOrElementCommon().
llvm-svn: 78349
|
|
|
|
|
|
| |
involving reasoning about unions (which we don't handle yet).
llvm-svn: 78342
|
|
|
|
| |
llvm-svn: 78305
|
|
|
|
|
|
| |
LazyCompoundSVals.
llvm-svn: 78284
|
|
|
|
|
|
| |
are no longer needed.
llvm-svn: 78280
|
|
|
|
| |
llvm-svn: 78273
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
RegionStore already lazily abstracted the contents of arrays and structs, when
doing an assignment from one array/struct to another we did an explicit
element-wise copy, which resulted in a loss of laziness and huge performance
problem when analyzing many code bases.
Now RegionStoreManager handles such assignments using a new SVal could
'LazyCompoundSVal', which basically means the value of a given struct or array
(a MemRegion*) in a specific state (GRState). When we do a load from a field
whose encompassing struct binds to a LazyCompoundSVal, we essentially do a field
lookup in the original structure. This means we have essentially zero copying of
data for structs/arrays and everything stays lazy.
llvm-svn: 78268
|
|
|
|
|
|
| |
region to the worklist used to create the subregion map.
llvm-svn: 78228
|
|
|
|
|
|
| |
wouldn't correctly get registered in the SubRegion map.
llvm-svn: 78162
|