aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/GRExprEngine.cpp
diff options
context:
space:
mode:
authorZhongxing Xu <xuzhongxing@gmail.com>2009-04-03 07:33:13 +0000
committerZhongxing Xu <xuzhongxing@gmail.com>2009-04-03 07:33:13 +0000
commita1718c78770db93d1b762620f07728a56786f2ae (patch)
tree70d070d73cada56167a7100ceaa5f6c99dc076c4 /lib/Analysis/GRExprEngine.cpp
parent6d7d8398e71a8bd121d3b46e250f1dbcfb9679d4 (diff)
This is the first step to gradually remove the use of loc::SymbolVal. Now
when creating symbolic values, we distinguish between location and non-location values. For location values, we create a symbolic region instead of a loc::SymbolVal. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68373 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/GRExprEngine.cpp')
-rw-r--r--lib/Analysis/GRExprEngine.cpp19
1 files changed, 17 insertions, 2 deletions
diff --git a/lib/Analysis/GRExprEngine.cpp b/lib/Analysis/GRExprEngine.cpp
index 0e3d3ad2d4..487aac06c5 100644
--- a/lib/Analysis/GRExprEngine.cpp
+++ b/lib/Analysis/GRExprEngine.cpp
@@ -1138,7 +1138,7 @@ GRExprEngine::NodeTy* GRExprEngine::EvalLocation(Stmt* Ex, NodeTy* Pred,
bool isFeasibleNull = false;
GRStateRef StNull = GRStateRef(Assume(state, LV, false, isFeasibleNull),
getStateManager());
-
+
if (isFeasibleNull) {
// Use the Generic Data Map to mark in the state what lval was null.
@@ -1920,7 +1920,22 @@ void GRExprEngine::VisitCast(Expr* CastE, Expr* Ex, NodeTy* Pred, NodeSet& Dst){
// to a desugared type.
assert(Loc::IsLocType(T));
- assert(Loc::IsLocType(ExTy));
+ // We get a symbolic function pointer for a dereference of a function
+ // pointer, but it is of function type. Example:
+
+ // struct FPRec {
+ // void (*my_func)(int * x);
+ // };
+ //
+ // int bar(int x);
+ //
+ // int f1_a(struct FPRec* foo) {
+ // int x;
+ // (*foo->my_func)(&x);
+ // return bar(x)+1; // no-warning
+ // }
+
+ assert(Loc::IsLocType(ExTy) || ExTy->isFunctionType());
const MemRegion* R = RV->getRegion();
StoreManager& StoreMgr = getStoreManager();