Skip to content

Commit

Permalink
[NFC][CLANG] Fix static analyzer bugs about large copy by values (#75060
Browse files Browse the repository at this point in the history
)

Reported by Static Analyzer tool:

In getSourceRangeToTokenEnd(clang::Decl const *, clang::SourceManager
const &, clang::LangOptions): A very large function call parameter
exceeding the high threshold is passed by value

pass_by_value: Passing parameter LangOpts of type clang::LangOptions
(size 1784 bytes) by value, which exceeds the high threshold of 512
bytes
  • Loading branch information
smanna12 committed Dec 12, 2023
1 parent b730703 commit a9b3054
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion clang/lib/Analysis/UnsafeBufferUsage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1534,7 +1534,7 @@ static bool hasUnsupportedSpecifiers(const VarDecl *VD,
// returned by this function is the last location of the last token.
static SourceRange getSourceRangeToTokenEnd(const Decl *D,
const SourceManager &SM,
LangOptions LangOpts) {
const LangOptions &LangOpts) {
SourceLocation Begin = D->getBeginLoc();
SourceLocation
End = // `D->getEndLoc` should always return the starting location of the
Expand Down

0 comments on commit a9b3054

Please sign in to comment.