aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/clang/Analysis/PathSensitive/GRState.h2
-rw-r--r--include/clang/Analysis/PathSensitive/Store.h2
-rw-r--r--lib/Analysis/BasicStore.cpp2
-rw-r--r--lib/Analysis/GRExprEngine.cpp2
-rw-r--r--lib/Analysis/RegionStore.cpp9
5 files changed, 6 insertions, 11 deletions
diff --git a/include/clang/Analysis/PathSensitive/GRState.h b/include/clang/Analysis/PathSensitive/GRState.h
index 7110c7bc2d..c1736116a7 100644
--- a/include/clang/Analysis/PathSensitive/GRState.h
+++ b/include/clang/Analysis/PathSensitive/GRState.h
@@ -461,7 +461,7 @@ public:
return BindExpr(St, Ex, V, isBlkExpr, Invalidate);
}
- SVal ArrayToPointer(SVal Array) {
+ SVal ArrayToPointer(Loc Array) {
return StoreMgr->ArrayToPointer(Array);
}
diff --git a/include/clang/Analysis/PathSensitive/Store.h b/include/clang/Analysis/PathSensitive/Store.h
index c52f389370..ea7c496ff9 100644
--- a/include/clang/Analysis/PathSensitive/Store.h
+++ b/include/clang/Analysis/PathSensitive/Store.h
@@ -106,7 +106,7 @@ public:
/// ArrayToPointer - Used by GRExprEngine::VistCast to handle implicit
/// conversions between arrays and pointers.
- virtual SVal ArrayToPointer(SVal Array) = 0;
+ virtual SVal ArrayToPointer(Loc Array) = 0;
class CastResult {
diff --git a/lib/Analysis/BasicStore.cpp b/lib/Analysis/BasicStore.cpp
index 8c5b71f234..cb6fcab380 100644
--- a/lib/Analysis/BasicStore.cpp
+++ b/lib/Analysis/BasicStore.cpp
@@ -85,7 +85,7 @@ public:
/// ArrayToPointer - Used by GRExprEngine::VistCast to handle implicit
/// conversions between arrays and pointers.
- SVal ArrayToPointer(SVal Array) { return Array; }
+ SVal ArrayToPointer(Loc Array) { return Array; }
/// CastRegion - Used by GRExprEngine::VisitCast to handle casts from
/// a MemRegion* to a specific location type. 'R' is the region being
diff --git a/lib/Analysis/GRExprEngine.cpp b/lib/Analysis/GRExprEngine.cpp
index 8241d13a0b..41f6453a90 100644
--- a/lib/Analysis/GRExprEngine.cpp
+++ b/lib/Analysis/GRExprEngine.cpp
@@ -1877,7 +1877,7 @@ void GRExprEngine::VisitCast(Expr* CastE, Expr* Ex, NodeTy* Pred, NodeSet& Dst){
// Check for casts from array type to another type.
if (ExTy->isArrayType()) {
// We will always decay to a pointer.
- V = StateMgr.ArrayToPointer(V);
+ V = StateMgr.ArrayToPointer(cast<Loc>(V));
// Are we casting from an array to a pointer? If so just pass on
// the decayed value.
diff --git a/lib/Analysis/RegionStore.cpp b/lib/Analysis/RegionStore.cpp
index 59891f27cf..60948062f6 100644
--- a/lib/Analysis/RegionStore.cpp
+++ b/lib/Analysis/RegionStore.cpp
@@ -199,7 +199,7 @@ public:
/// version of that lvalue (i.e., a pointer to the first element of
/// the array). This is called by GRExprEngine when evaluating
/// casts from arrays to pointers.
- SVal ArrayToPointer(SVal Array);
+ SVal ArrayToPointer(Loc Array);
/// CastRegion - Used by GRExprEngine::VisitCast to handle casts from
/// a MemRegion* to a specific location type. 'R' is the region being
@@ -562,12 +562,7 @@ SVal RegionStoreManager::getSizeInElements(const GRState* St,
/// version of that lvalue (i.e., a pointer to the first element of
/// the array). This is called by GRExprEngine when evaluating casts
/// from arrays to pointers.
-SVal RegionStoreManager::ArrayToPointer(SVal Array) {
- // FIXME: This should be factored into GRExprEngine. This allows
- // us to pass a "loc" instead of an "SVal" for "Array".
- if (Array.isUnknownOrUndef())
- return Array;
-
+SVal RegionStoreManager::ArrayToPointer(Loc Array) {
if (!isa<loc::MemRegionVal>(Array))
return UnknownVal();