aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/SimpleSValuator.cpp
AgeCommit message (Collapse)Author
2009-10-17Fix another static analyzer crash due to a corner case in "folding" symbolic ↵Ted Kremenek
values that are constrained to be a constant. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84320 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-16Fix static analyzer crash due to recently add symbolic-value constant ↵Ted Kremenek
folding. The issue was falsely converting the constant value of the LHS of a '<<'/'>>' operation to the same APSInt value of the RHS. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84269 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-06Fix crash introduced by r83358 where a symbol could be eagerlyTed Kremenek
evaluated to an APSInt with a different bitwidth than the other operand in a binary expression. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83368 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-06Fix: <rdar://problem/7275774> Static analyzer warns about NULL pointer whenTed Kremenek
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: git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83358 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-25Fix <rdar://problem/7249327> by allowing silent conversions between signed ↵Ted Kremenek
and unsigned integer values for symbolic values. This is an intermediate solution (i.e. hack) until we support extension/truncation of symbolic integers. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82737 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-11Introduce "DefinedOrUnknownSVal" into the SVal class hierarchy, providing a wayTed Kremenek
to statically type various methods in SValuator/GRState as required either a defined value or a defined-but-possibly-unknown value. This leads to various logic cleanups in GRExprEngine, and lets the compiler enforce via type checking our assumptions about what symbolic values are possibly undefined and what are not. Along the way, clean up some of the static analyzer diagnostics regarding the uses of uninitialized values. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81579 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-09Remove tabs, and whitespace cleanups.Mike Stump
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81346 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-21Fix PR 4594 by refactoring almost all casting logic from GRExprEngine::VisitCastTed Kremenek
to SValuator::EvalCast. In the process, the StoreManagers now use this new cast machinery, and the hack in GRExprEngine::EvalBind to handle implicit casts involving OSAtomicCompareAndSwap and friends has been removed (and replaced with logic closer to the logic specific to those functions). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76641 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-21RegionStore:Ted Kremenek
-refactor logic for retrieving bindings from VarDecls into RegionStoreManager::RetrieveVar() - improve RegionStoreManager::CastRetrievedVal() and SimpleSValuate::EvalCastNL to better handle casts of values of the same canonical type as well as casts of LocAsInteger values. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76516 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-20Enhance SimpleSValuator to handle nonloc::LocAsInteger -> location casts.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76481 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-16Move RegionStoreManager over to using newTed Kremenek
ValueManager::makeArrayIndex()/convertArrayIndex() methods. This handles yet another crash case when reasoning about array indices of different bitwidth and signedness. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75884 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-13Enhance SimpleSValuator::EvalBinOpNN to recognize the trivial caseTed Kremenek
where we are comparing a symbolic value against itself, regardless of the nature of that symbolic value. This enhancement identified a case where RegionStoreManager is not correctly symbolicating the values of the pointees of parameters. The failing test is now in 'test/Analysis/misc-ps-region-store.m', with that test file now (temporarily) marked XFAIL. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75521 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-26Unbreak build.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74238 91177308-0d34-0410-b5e6-96231b3b80d8