]> granicus.if.org Git - clang/commitdiff
Bug fix: for the base transfer function logic for casts, handle const casts as just...
authorTed Kremenek <kremenek@apple.com>
Fri, 19 Sep 2008 20:51:22 +0000 (20:51 +0000)
committerTed Kremenek <kremenek@apple.com>
Fri, 19 Sep 2008 20:51:22 +0000 (20:51 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56368 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/GRExprEngine.cpp

index 35facb35aef4131f133743b660c8c44231ac8923..423c4850d8ec70b89cf2a44ceb81a380cfb1d3e0 100644 (file)
@@ -1432,6 +1432,15 @@ void GRExprEngine::VisitCast(Expr* CastE, Expr* Ex, NodeTy* Pred, NodeSet& Dst){
       MakeNode(Dst, CastE, N, SetRVal(St, CastE, V));
       continue;
     }
+    
+    // For const casts, just propagate the value.
+    ASTContext& C = getContext();
+    
+    if (C.getCanonicalType(T).getUnqualifiedType() == 
+        C.getCanonicalType(ExTy).getUnqualifiedType()) {
+      MakeNode(Dst, CastE, N, SetRVal(St, CastE, V));
+      continue;
+    }
   
     // Check for casts from pointers to integers.
     if (T->isIntegerType() && LVal::IsLValType(ExTy)) {