diff options
-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()); |