diff options
author | Ted Kremenek <kremenek@apple.com> | 2009-02-24 02:23:11 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2009-02-24 02:23:11 +0000 |
commit | 265a305997c63a28d87ddd370958db083f98bc1a (patch) | |
tree | f079652934da5dd6fa0596d2198ad45079be480e /lib/Analysis/GRExprEngine.cpp | |
parent | 1c56667febcf8e2d78bd8c1c720eca1888ff1d60 (diff) |
Fix <rdar://problem/6611677>: Add basic transfer function support in the static
analyzer for array subscript expressions involving bases that are vectors. This
solution is probably a hack: it gets the lvalue of the vector instead of an
rvalue like all other types. This should be reviewed (big FIXME in
GRExprEngine).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65366 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/GRExprEngine.cpp')
-rw-r--r-- | lib/Analysis/GRExprEngine.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/Analysis/GRExprEngine.cpp b/lib/Analysis/GRExprEngine.cpp index 60bef6eb71..d34e8a3ed3 100644 --- a/lib/Analysis/GRExprEngine.cpp +++ b/lib/Analysis/GRExprEngine.cpp @@ -850,7 +850,16 @@ void GRExprEngine::VisitArraySubscriptExpr(ArraySubscriptExpr* A, NodeTy* Pred, Expr* Base = A->getBase()->IgnoreParens(); Expr* Idx = A->getIdx()->IgnoreParens(); NodeSet Tmp; - Visit(Base, Pred, Tmp); // Get Base's rvalue, which should be an LocVal. + + if (Base->getType()->isVectorType()) { + // For vector types get its lvalue. + // FIXME: This may not be correct. Is the rvalue of a vector its location? + // In fact, I think this is just a hack. We need to get the right + // semantics. + VisitLValue(Base, Pred, Tmp); + } + else + Visit(Base, Pred, Tmp); // Get Base's rvalue, which should be an LocVal. for (NodeSet::iterator I1=Tmp.begin(), E1=Tmp.end(); I1!=E1; ++I1) { NodeSet Tmp2; |