Skip to content

Commit 36ce3c4

Browse files
committed
Add one more test case.
1 parent a9c8d85 commit 36ce3c4

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

clang/test/Analysis/Checkers/WebKit/uncounted-local-vars.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,12 @@ void foo8(RefCountable* obj) {
117117
foo = obj ? obj : nullptr;
118118
bar->method();
119119
}
120+
{
121+
RefCountable *bar = foo->trivial() ? foo.get() : nullptr;
122+
// expected-warning@-1{{Local variable 'bar' is uncounted and unsafe [alpha.webkit.UncountedLocalVarsChecker]}}
123+
foo = nullptr;
124+
bar->method();
125+
}
120126
}
121127

122128
void foo9(RefCountable& o) {

0 commit comments

Comments
 (0)