Added boilerplate transfer function support for pointer arithmetic operations.

llvm-svn: 47147
diff --git a/clang/Analysis/GRExprEngine.cpp b/clang/Analysis/GRExprEngine.cpp
index 15f1aa2..bbf06d9 100644
--- a/clang/Analysis/GRExprEngine.cpp
+++ b/clang/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);