baloghadamsoftware closed this revision.
baloghadamsoftware added a comment.
Closed by commit https://reviews.llvm.org/rL318912.
https://reviews.llvm.org/D39367
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
baloghadamsoftware updated this revision to Diff 121691.
baloghadamsoftware added a comment.
Updated to match https://reviews.llvm.org/D39121.
https://reviews.llvm.org/D39367
Files:
clang-tidy/bugprone/MisplacedOperatorInStrlenInAllocCheck.cpp
docs/ReleaseNotes.rst
aaron.ballman accepted this revision.
aaron.ballman added a comment.
This revision is now accepted and ready to land.
LGTM
https://reviews.llvm.org/D39367
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
baloghadamsoftware updated this revision to Diff 120776.
baloghadamsoftware added a comment.
Oops! Sorry!
https://reviews.llvm.org/D39367
Files:
clang-tidy/bugprone/MisplacedOperatorInStrlenInAllocCheck.cpp
clang-tidy/bugprone/MisplacedOperatorInStrlenInAllocCheck.h
docs/ReleaseNotes.rst
aaron.ballman added inline comments.
Comment at: clang-tidy/bugprone/MisplacedOperatorInStrlenInAllocCheck.cpp:64-65
+Alloc = Result.Nodes.getNodeAs("Alloc");
+ assert(Alloc && "Matched node bound by `Alloc` shoud be either `CallExpr`"
+ " or `CXXNewExpr`");
+
baloghadamsoftware updated this revision to Diff 120595.
baloghadamsoftware added a comment.
Herald added a subscriber: mgorny.
Backsticks changed to single quotes, new tests added.
https://reviews.llvm.org/D39367
Files:
clang-tidy/bugprone/BugproneTidyModule.cpp
aaron.ballman added inline comments.
Comment at: clang-tidy/bugprone/MisplacedOperatorInStrlenInAllocCheck.cpp:64-65
+Alloc = Result.Nodes.getNodeAs("Alloc");
+ assert(Alloc && "Matched node bound by `Alloc` shoud be either `CallExpr`"
+ " or `CXXNewExpr`");
+
baloghadamsoftware marked an inline comment as done.
baloghadamsoftware added a comment.
In https://reviews.llvm.org/D39367#909117, @JonasToth wrote:
> Should the release notes be modified as well?
I think so. I consider the inclusion of operator `new[]` important.
baloghadamsoftware updated this revision to Diff 120579.
baloghadamsoftware added a comment.
Reformatted according to the comments.
https://reviews.llvm.org/D39367
Files:
clang-tidy/bugprone/MisplacedOperatorInStrlenInAllocCheck.cpp
docs/ReleaseNotes.rst
JonasToth added a comment.
Should the release notes be modified as well?
Repository:
rL LLVM
https://reviews.llvm.org/D39367
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
JonasToth added inline comments.
Comment at: clang-tidy/bugprone/MisplacedOperatorInStrlenInAllocCheck.cpp:62
+ const Expr *Alloc = Result.Nodes.getNodeAs("Alloc");
+ if (!Alloc) Alloc = Result.Nodes.getNodeAs("Alloc");
const auto *StrLen = Result.Nodes.getNodeAs("StrLen");
baloghadamsoftware created this revision.
Herald added a subscriber: rnkovacs.
The check now recognizes error cases like `new char[strlen(s + 1)]` and
suggests a fix in the format `new char[strlen(s) + 1]`.
https://reviews.llvm.org/D39367
Files:
12 matches
Mail list logo