Added boilerplate transfer function support for pointer arithmetic operations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47147 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Analysis/GRExprEngine.cpp b/Analysis/GRExprEngine.cpp
index 15f1aa2..bbf06d9 100644
--- a/Analysis/GRExprEngine.cpp
+++ b/Analysis/GRExprEngine.cpp
@@ -706,9 +706,17 @@
         if (isa<LValue>(V1)) {
           // FIXME: Add support for RHS being a non-lvalue.
           const LValue& L1 = cast<LValue>(V1);
-          const LValue& L2 = cast<LValue>(V2);
           
-          Nodify(Dst, B, N2, SetValue(St, B, EvalBinaryOp(ValMgr, Op, L1, L2)));
+          if (isa<LValue>(V2)) {          
+            const LValue& L2 = cast<LValue>(V2);
+            Nodify(Dst, B, N2, SetValue(St, B,
+                                        EvalBinaryOp(ValMgr, Op, L1, L2)));
+          }
+          else {
+            const NonLValue& R2 = cast<NonLValue>(V2);
+            Nodify(Dst, B, N2, SetValue(St, B,
+                                        EvalBinaryOp(ValMgr, Op, L1, R2)));
+          }
         }
         else {
           const NonLValue& R1 = cast<NonLValue>(V1);