Enhance modularization: return a <state,loc> pair to let GRExprEngine modify the
environment.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59407 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Analysis/GRExprEngine.cpp b/lib/Analysis/GRExprEngine.cpp
index e002c13..fe7d6f9 100644
--- a/lib/Analysis/GRExprEngine.cpp
+++ b/lib/Analysis/GRExprEngine.cpp
@@ -1698,11 +1698,15 @@
       assert(Loc::IsLocType(ExTy));
 
       // Delegate to store manager.
-      const GRState* NewSt = getStoreManager().CastRegion(St, V, T, CastE);
+      std::pair<const GRState*, SVal> Res =  
+        getStoreManager().CastRegion(St, V, T, CastE);
+
+      const GRState* NewSt = Res.first;
+      SVal NewPtr = Res.second;
 
       // If no new region is created, fall through to the default case.
       if (NewSt != St) {
-        MakeNode(Dst, CastE, N, NewSt);
+        MakeNode(Dst, CastE, N, BindExpr(NewSt, CastE, NewPtr));
         continue;
       }
     }