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
5 changes: 4 additions & 1 deletion clang/lib/StaticAnalyzer/Checkers/WebKit/ASTUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,10 @@ bool tryToFindPtrOrigin(
E = unaryOp->getSubExpr();
continue;
}

if (auto *BoxedExpr = dyn_cast<ObjCBoxedExpr>(E)) {
E = BoxedExpr->getSubExpr();
continue;
}
break;
}
// Some other expression.
Expand Down
4 changes: 4 additions & 0 deletions clang/test/Analysis/Checkers/WebKit/unretained-call-args.mm
Original file line number Diff line number Diff line change
Expand Up @@ -329,13 +329,17 @@ void foo() {
}
}

#define YES 1

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not familiar with the static analyzer tests. Is this basically implicitly checking that this new code doesn't generate an analyzer warning?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah.

namespace call_with_cf_constant {
void bar(const NSArray *);
void baz(const NSDictionary *);
void boo(NSNumber *);
void foo() {
CFArrayCreateMutable(kCFAllocatorDefault, 10);
bar(@[@"hello"]);
baz(@{@"hello": @3});
boo(@YES);
}
}

Expand Down