aboutsummaryrefslogtreecommitdiff
path: root/lib/Checker
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2010-02-14 19:08:43 +0000
committerTed Kremenek <kremenek@apple.com>2010-02-14 19:08:43 +0000
commit005f09b77d9c3f3500f73ce9c0db755df005b167 (patch)
treeda684f709d4a37040df6b8acbcc60e35a9bb8d13 /lib/Checker
parent55abf16c7aec8c3063c368707857795afd06e21d (diff)
For the StringRef check, also visit the children of DeclStmts.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96181 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Checker')
-rw-r--r--lib/Checker/LLVMConventionsChecker.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Checker/LLVMConventionsChecker.cpp b/lib/Checker/LLVMConventionsChecker.cpp
index 4e69f2916f..7cd98b0319 100644
--- a/lib/Checker/LLVMConventionsChecker.cpp
+++ b/lib/Checker/LLVMConventionsChecker.cpp
@@ -74,6 +74,7 @@ public:
void VisitDeclStmt(DeclStmt *DS);
private:
void VisitVarDecl(VarDecl *VD);
+ void CheckStringRefBoundtoTemporaryString(VarDecl *VD);
};
} // end anonymous namespace
@@ -83,6 +84,8 @@ static void CheckStringRefAssignedTemporary(const Decl *D, BugReporter &BR) {
}
void StringRefCheckerVisitor::VisitDeclStmt(DeclStmt *S) {
+ VisitChildren(S);
+
for (DeclStmt::decl_iterator I = S->decl_begin(), E = S->decl_end();I!=E; ++I)
if (VarDecl *VD = dyn_cast<VarDecl>(*I))
VisitVarDecl(VD);