aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/GRExprEngine.cpp
diff options
context:
space:
mode:
authorZhongxing Xu <xuzhongxing@gmail.com>2008-11-24 09:44:56 +0000
committerZhongxing Xu <xuzhongxing@gmail.com>2008-11-24 09:44:56 +0000
commitbaf03a7c0a846632396f9f5a19f6cd45bbe2b926 (patch)
treeefc69498cc8879059ecd5c90ea5db44a4b1acbd8 /lib/Analysis/GRExprEngine.cpp
parent8b8627380638d0889d6924d1ec10d42a9c743593 (diff)
Add support for AllocaRegion extent with GDM.
One design problem that is emerging is the signed-ness problem during static analysis. Many unsigned value have to be converted into signed value because it partipates in operations with signed values. On the other hand, we cannot blindly make all values occuring in static analysis signed, because we do have cases where unsignedness is required, for example, integer overflow detection. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59957 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/GRExprEngine.cpp')
-rw-r--r--lib/Analysis/GRExprEngine.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Analysis/GRExprEngine.cpp b/lib/Analysis/GRExprEngine.cpp
index cb1aceafac..ea88e70afa 100644
--- a/lib/Analysis/GRExprEngine.cpp
+++ b/lib/Analysis/GRExprEngine.cpp
@@ -1291,6 +1291,13 @@ void GRExprEngine::VisitCallRec(CallExpr* CE, NodeTy* Pred,
MemRegionManager& RM = getStateManager().getRegionManager();
const MemRegion* R =
RM.getAllocaRegion(CE, Builder->getCurrentBlockCount());
+
+ // Set the extent of the region in bytes. This enables us to use the
+ // SVal of the argument directly. If we save the extent in bits, we
+ // cannot represent values like symbol*8.
+ SVal Extent = GetSVal(St, *(CE->arg_begin()));
+ St = getStoreManager().setExtent(St, R, Extent);
+
MakeNode(Dst, CE, *DI, BindExpr(St, CE, loc::MemRegionVal(R)));
continue;
}