diff options
author | Ted Kremenek <kremenek@apple.com> | 2008-04-30 21:10:19 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2008-04-30 21:10:19 +0000 |
commit | e8c2bde0d335a7512f453e872f064f023d48c16f (patch) | |
tree | 69020c178325860bb9308f2f22d40f573875680a | |
parent | c52c89a5ebd7e7aea7944a666445807e8be26b1e (diff) |
Support implicit casts from pointers to references.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50498 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Analysis/GRSimpleVals.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
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()); |