Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ class RawPtrRefLocalVarsChecker
if (tryToFindPtrOrigin(
Value, /*StopAtFirstRefCountedObj=*/false,
[&](const clang::Expr *InitArgOrigin, bool IsSafe) {
if (!InitArgOrigin)
if (!InitArgOrigin || IsSafe)
return true;

if (isa<CXXThisExpr>(InitArgOrigin))
Expand Down
9 changes: 9 additions & 0 deletions clang/test/Analysis/Checkers/WebKit/uncounted-local-vars.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -456,3 +456,12 @@ int TreeNode::recursiveWeight() {
}

} // namespace local_var_in_recursive_function

namespace local_var_for_singleton {
RefCountable *singleton();
RefCountable *otherSingleton();
void foo() {
RefCountable* bar = singleton();
RefCountable* baz = otherSingleton();
}
}
Loading