| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
handling (for C++). No functionality change for now.
llvm-svn: 94153
|
|
|
|
|
|
| |
intermediate destination set Tmp4.
llvm-svn: 93873
|
|
|
|
|
|
|
|
|
|
| |
"ASTContext::getTypeSize() / 8". Replace [u]int64_t variables with CharUnits
ones as appropriate.
Also rename RawType, fromRaw(), and getRaw() in CharUnits to QuantityType,
fromQuantity(), and getQuantity() for clarity.
llvm-svn: 93153
|
|
|
|
|
|
|
|
|
| |
CallExpr/ObjCMessageExpr can be visited in an "lvalue" context if it
returns a struct temporary. Currently the analyzer doesn't reason
about struct temporary returned by function calls, but we shouldn't
crash here either.
llvm-svn: 93081
|
|
|
|
|
|
|
|
| |
CXXObjectRegion to represent it.
In Environment, lookup a literal expression before make up a value for it.
llvm-svn: 93047
|
|
|
|
|
|
|
|
|
| |
when the default case is winnowed down to be infeasible. When all
cases were ruled out (and the analysis state for the default case
would be infeasible) we would still consider the default case
possible. This fixes PR 5969.
llvm-svn: 93017
|
|
|
|
|
|
| |
Essentially treat 'this' as a implicit parameter to the method call, and associate a region with it.
llvm-svn: 92675
|
|
|
|
|
|
|
|
|
|
|
|
| |
GRStateManager. Having these references was an abstraction violation,
as they really should only be known about GRExprEngine.
This change required adding a new 'ProcessAssume' callback in
GRSubEngine. GRExprEngine implements this callback by calling
'EvalAssume' on all registered Checker objects as well as the
registered GRTransferFunc object.
llvm-svn: 92549
|
|
|
|
|
|
|
|
|
| |
Add new states for symbolic regions tracked by malloc checker. This enables us
to do malloc checking more accurately. See test case.
Based on Lei Zhang's patch and discussion.
llvm-svn: 92342
|
|
|
|
| |
llvm-svn: 92162
|
|
|
|
|
|
| |
GRExprEngine.cpp(1348) : warning C4305: 'argument' : truncation from 'clang::ProgramPoint::Kind' to 'bool'
llvm-svn: 92154
|
|
|
|
|
|
| |
a ForStmt.
llvm-svn: 92114
|
|
|
|
|
|
| |
a WhileStmt.
llvm-svn: 92106
|
|
|
|
|
|
| |
a SwitchStmt.
llvm-svn: 92102
|
|
|
|
|
|
|
|
| |
mode.
Add transfer function support in GRExprEngine for IfStmts with initialized condition variables.
llvm-svn: 91987
|
|
|
|
| |
llvm-svn: 91985
|
|
|
|
| |
llvm-svn: 91982
|
|
|
|
| |
llvm-svn: 91970
|
|
|
|
|
|
| |
GRExprEngine::VisitCast when the expression is handled as an lvalue.
llvm-svn: 91969
|
|
|
|
| |
llvm-svn: 91952
|
|
|
|
|
|
| |
expression as an lvalue when the return type is a C++ reference.
llvm-svn: 91926
|
|
|
|
|
|
| |
Uncovered a new failing test case along the way, but we're making progress on handling C++ references in the analyzer.
llvm-svn: 91710
|
|
|
|
| |
llvm-svn: 91615
|
|
|
|
|
|
| |
to evaluate the arguments of a CallExpr. This simplifies the logic and makes it easier to read. (it also avoids any issues with blowing out the stack if the CallExpr had a ridiculous number of arguments)
llvm-svn: 91613
|
|
|
|
| |
llvm-svn: 91610
|
|
|
|
| |
llvm-svn: 91591
|
|
|
|
|
|
| |
IdentifierInfo*'s.
llvm-svn: 91577
|
|
|
|
|
|
|
|
| |
attribute: the object type.
Add initial support for visiting CXXThisExpr.
Fix a bunch of 80-col violations.
llvm-svn: 91535
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change was a lot bigger than I originally anticipated; among
other things it requires us storing more information in the CFG to
record what block-level expressions need to be evaluated as lvalues.
The big change is that CFGBlocks no longer contain Stmt*'s by
CFGElements. Currently CFGElements just wrap Stmt*, but they also
store a bit indicating whether the block-level expression should be
evalauted as an lvalue. DeclStmts involving the initialization of a
reference require us treating the initialization expression as an
lvalue, even though that information isn't recorded in the AST.
Conceptually this change isn't that complicated, but it required
bubbling up the data through the CFGBuilder, to GRCoreEngine, and
eventually to GRExprEngine.
The addition of CFGElement is also useful for when we want to handle
more control-flow constructs or other data we want to keep in the CFG
that isn't represented well with just a block of statements.
In GRExprEngine, this patch introduces logic for evaluating the
lvalues of references, which currently retrieves the internal "pointer
value" that the reference represents. EvalLoad does a two stage load
to catch null dereferences involving an invalid reference (although
this could possibly be caught earlier during the initialization of a
reference).
Symbols are currently symbolicated using the reference type, instead
of a pointer type, and special handling is required creating
ElementRegions that layer on SymbolicRegions (see the changes to
RegionStoreManager).
Along the way, the DeadStoresChecker also silences warnings involving
dead stores to references. This was the original change I introduced
(which I wrote test cases for) that I realized caused GRExprEngine to
crash.
llvm-svn: 91501
|
|
|
|
|
|
|
|
| |
now, don't construct CFGs that contain C++ try/catch statements, and
have GRExprEngine abort a path if it encounters a C++ construct it
doesn't understand (which is mostly everything at this point).
llvm-svn: 91389
|
|
|
|
|
|
| |
captured block variables that are passed by reference
llvm-svn: 91348
|
|
|
|
| |
llvm-svn: 91258
|
|
|
|
| |
llvm-svn: 90968
|
|
|
|
|
|
|
|
| |
Otherwise, even when real evaluation occurs, the previous fake auto
transitions would still be in the destination set, causing fake state
bifurcation.
llvm-svn: 90967
|
|
|
|
|
|
|
|
| |
instead of the ElementRegion obtained from casts.
Test cast: the leak cannot occur bacause the true branch cannot be taken.
llvm-svn: 90964
|
|
|
|
| |
llvm-svn: 90953
|
|
|
|
|
|
| |
repeatedly.
llvm-svn: 90952
|
|
|
|
|
|
|
|
|
| |
by the test case in PR 5627. Essentially we shouldn't clear the
ExplodedNodeSet where we deposit newly constructed nodes if that set
is the 'Dst' set passed in. It is not okay to clear that set because
it may already contain nodes.
llvm-svn: 90931
|
|
|
|
| |
llvm-svn: 90847
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Refactor the MemRegion hierarchy to distinguish between different StackSpaceRegions for locals and parameters.
- VarRegions for "captured" variables now have the BlockDataRegion as their super region (except those passed by reference)
- Add transfer function support to GRExprEngine for BlockDeclRefExprs.
This change also supports analyzing blocks as an analysis entry point
(top-of-the-stack), which required pushing more context-sensitivity
around in the MemRegion hierarchy via the use of LocationContext
objects. Functionally almost everything is the same, except we track
LocationContexts in a few more areas and StackSpaceRegions now refer
to a StackFrameContext object. In the future we will need to modify
MemRegionManager to allow multiple StackSpaceRegions in flight at once
(for the analysis of multiple stack frames).
llvm-svn: 90809
|
|
|
|
|
|
|
|
|
| |
handler to this interface.
GRExprEngine::CheckerEvalCall() will return true if one of the checkers has
processed the node. In the future this might return void when we have some
default checker.
llvm-svn: 90755
|
|
|
|
|
|
|
|
|
|
|
| |
we don't need to use the DoneEvaluation hack when check for
ObjCMessageExpr.
PreVisitObjCMessageExpr() only checks for undefined receiver or arguments.
Add checker interface EvalNilReceiver(). This is a 'once-and-done' interface.
llvm-svn: 90296
|
|
|
|
| |
llvm-svn: 90139
|
|
|
|
| |
llvm-svn: 90137
|
|
|
|
| |
llvm-svn: 90028
|
|
|
|
|
|
|
|
|
|
|
| |
'BlockDataRegion' to distinguish between the code associated with a
block (which is represented by 'BlockTextRegion') and an instance of a
block, which includes both code and data. 'BlockDataRegion' has an
associated LocationContext, which can be used to eventually model the
lifetime of a block object once LocationContexts can represent scopes
(and iterations around a loop, etc.).
llvm-svn: 89900
|
|
|
|
| |
llvm-svn: 89890
|
|
|
|
|
|
| |
by making it a static function within GRExprEngine.cpp.
llvm-svn: 89884
|
|
|
|
|
|
| |
manually in AnalysisConsumer.cpp.
llvm-svn: 89883
|
|
|
|
|
|
|
|
|
| |
only stop processing the checkers after all the nodes for a current
check have been processed. This (I believe) handles the case where
PredSet (the input nodes) contains more than one node due to state
bifurcation. Zhongxing: can you review this?
llvm-svn: 89882
|