From e8c2bde0d335a7512f453e872f064f023d48c16f Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Wed, 30 Apr 2008 21:10:19 +0000 Subject: [PATCH] Support implicit casts from pointers to references. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50498 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Analysis/GRSimpleVals.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/Analysis/GRSimpleVals.cpp b/lib/Analysis/GRSimpleVals.cpp index b496f26443..aa1dc7e8cb 100644 --- a/lib/Analysis/GRSimpleVals.cpp +++ b/lib/Analysis/GRSimpleVals.cpp @@ -320,7 +320,13 @@ RVal GRSimpleVals::EvalCast(GRExprEngine& Eng, NonLVal X, QualType T) { 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()); -- 2.50.1