diff options
author | Ted Kremenek <kremenek@apple.com> | 2009-04-01 06:52:48 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2009-04-01 06:52:48 +0000 |
commit | 8b0dba358a3fae6695aff56a150b9e18f66e0cf3 (patch) | |
tree | 39336620737513cc431993a0a611585d0ecf7b34 /clang/include | |
parent | 3088a31e96ab75f567e272dc5f6ca5fe347d6caa (diff) | |
download | bcm5719-llvm-8b0dba358a3fae6695aff56a150b9e18f66e0cf3.tar.gz bcm5719-llvm-8b0dba358a3fae6695aff56a150b9e18f66e0cf3.zip |
Fix: <rdar://problem/6740387>. Sending nil to an object that returns a struct
should only be an error if that value is consumed. This fix was largely
accomplished by moving 'isConsumedExpr' back to ParentMap.
llvm-svn: 68195
Diffstat (limited to 'clang/include')
-rw-r--r-- | clang/include/clang/AST/ParentMap.h | 7 | ||||
-rw-r--r-- | clang/include/clang/Analysis/PathSensitive/GRExprEngine.h | 2 |
2 files changed, 8 insertions, 1 deletions
diff --git a/clang/include/clang/AST/ParentMap.h b/clang/include/clang/AST/ParentMap.h index 94890e3feb5..199a360ca0d 100644 --- a/clang/include/clang/AST/ParentMap.h +++ b/clang/include/clang/AST/ParentMap.h @@ -16,6 +16,7 @@ namespace clang { class Stmt; +class Expr; class ParentMap { void* Impl; @@ -32,6 +33,12 @@ public: bool hasParent(Stmt* S) const { return getParent(S) != 0; } + + bool isConsumedExpr(Expr *E) const; + + bool isConsumedExpr(const Expr *E) const { + return isConsumedExpr(const_cast<Expr*>(E)); + } }; } // end clang namespace diff --git a/clang/include/clang/Analysis/PathSensitive/GRExprEngine.h b/clang/include/clang/Analysis/PathSensitive/GRExprEngine.h index 1dee5d267ad..f53a9abaad8 100644 --- a/clang/include/clang/Analysis/PathSensitive/GRExprEngine.h +++ b/clang/include/clang/Analysis/PathSensitive/GRExprEngine.h @@ -98,7 +98,7 @@ protected: // to lazily evaluate such logic. The downside is that it eagerly // bifurcates paths. const bool EagerlyAssume; - + public: typedef llvm::SmallPtrSet<NodeTy*,2> ErrorNodes; typedef llvm::DenseMap<NodeTy*, Expr*> UndefArgsTy; |