This revision was automatically updated to reflect the committed changes.
Closed by commit rC336495: [analyzer] Highlight c_str() call in
DanglingInternalBufferChecker. (authored by rkovacs, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D48522?vs=152719&id=154499#toc
Reposi
rnkovacs updated this revision to Diff 152719.
rnkovacs added a comment.
Fixed the constness of `c_str()` in the test file.
https://reviews.llvm.org/D48522
Files:
lib/StaticAnalyzer/Checkers/AllocationState.h
lib/StaticAnalyzer/Checkers/DanglingInternalBufferChecker.cpp
lib/StaticAnalyzer
rnkovacs updated this revision to Diff 152627.
rnkovacs marked an inline comment as done.
rnkovacs added a comment.
Fixed variable name inside the visitor.
I also clang-formatted the file, sorry for any line number shifting.
https://reviews.llvm.org/D48522
Files:
lib/StaticAnalyzer/Checkers/A
xazax.hun accepted this revision.
xazax.hun added inline comments.
Comment at: lib/StaticAnalyzer/Checkers/DanglingInternalBufferChecker.cpp:41
+// Tracked pointer to a buffer.
+SymbolRef Sym;
+
I am fine with this as is, but I prefer self documenting cod
rnkovacs updated this revision to Diff 152616.
rnkovacs marked 4 inline comments as done.
rnkovacs added a comment.
Thanks! Addressed comments.
https://reviews.llvm.org/D48522
Files:
lib/StaticAnalyzer/Checkers/AllocationState.h
lib/StaticAnalyzer/Checkers/DanglingInternalBufferChecker.cpp
NoQ accepted this revision.
NoQ added a comment.
This revision is now accepted and ready to land.
Looks good tho!
Comment at: lib/StaticAnalyzer/Checkers/DanglingInternalBufferChecker.cpp:63-64
+ RawPtrMapTy Map = State->get();
+ for (const auto Entry : Map) {
+
NoQ added inline comments.
Comment at: lib/StaticAnalyzer/Checkers/AllocationState.h:23-25
+std::unique_ptr
+getDanglingBufferBRVisitor(SymbolRef Sym);
+
I think we should start commenting this stuff up. Like, "This function provides
an additional visitor that a
xazax.hun added a comment.
Looks better, thanks!
Comment at: lib/StaticAnalyzer/Checkers/DanglingInternalBufferChecker.cpp:65
+if (Entry.second == Sym)
+ Found = true;
+ }
Maybe early return here?
https://reviews.llvm.org/D48522
_
rnkovacs updated this revision to Diff 152604.
rnkovacs marked an inline comment as done.
rnkovacs added a comment.
Um, sorry, I totally forgot about that. Added your case to the tests.
https://reviews.llvm.org/D48522
Files:
lib/StaticAnalyzer/Checkers/AllocationState.h
lib/StaticAnalyzer/C
xazax.hun added a comment.
Regarding the visitor:
Maybe rather than looking at the AST, we should check the states, when we
started to track the returned symbol?
Using your current design you need to check for the AST twice. Once in the
visitor and once in the check.
Also, I wonder if this alw
rnkovacs created this revision.
rnkovacs added reviewers: NoQ, xazax.hun, george.karpenkov, dcoughlin.
Herald added subscribers: mikhail.ramalho, a.sidorin, dkrupp, szepet,
baloghadamsoftware, whisperity.
Add a bug visitor to `DanglingInternalBuffer` checker that places a note at the
point where
11 matches
Mail list logo