[cfe-commits] r50498 - /cfe/trunk/lib/Analysis/GRSimpleVals.cpp

Ted Kremenek kremenek at apple.com
Wed Apr 30 14:10:20 PDT 2008


Author: kremenek
Date: Wed Apr 30 16:10:19 2008
New Revision: 50498

URL: http://llvm.org/viewvc/llvm-project?rev=50498&view=rev
Log:
Support implicit casts from pointers to references.

Modified:
    cfe/trunk/lib/Analysis/GRSimpleVals.cpp

Modified: cfe/trunk/lib/Analysis/GRSimpleVals.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/GRSimpleVals.cpp?rev=50498&r1=50497&r2=50498&view=diff

==============================================================================
--- cfe/trunk/lib/Analysis/GRSimpleVals.cpp (original)
+++ cfe/trunk/lib/Analysis/GRSimpleVals.cpp Wed Apr 30 16:10:19 2008
@@ -320,7 +320,13 @@
 
 RVal GRSimpleVals::EvalCast(GRExprEngine& Eng, LVal X, QualType T) {
   
-  if (IsPointerType(T))
+  // Casts from pointers -> pointers, just return the lval.
+  //
+  // Casts from pointers -> references, just return the lval.  These
+  //   can be introduced by the frontend for corner cases, e.g
+  //   casting from va_list* to __builtin_va_list&.
+  //
+  if (IsPointerType(T) || T->isReferenceType())
     return X;
   
   assert (T->isIntegerType());





More information about the cfe-commits mailing list