This revision was automatically updated to reflect the committed changes.
Closed by commit rL334348: [analyzer] Add dangling internal buffer check.
(authored by rkovacs, committed by ).
Herald added subscribers: llvm-commits, mikhail.ramalho.
Changed prior to commit:
https://reviews.llvm.org/D4
xbolva00 added a comment.
Ping
https://reviews.llvm.org/D47135
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
xbolva00 accepted this revision.
xbolva00 added a comment.
Looks fine, awesome feature!
https://reviews.llvm.org/D47135
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
NoQ added inline comments.
Comment at: lib/StaticAnalyzer/Checkers/DanglingInternalBufferChecker.cpp:33
+public:
+ DanglingInternalBufferChecker() : CStrFn("c_str") {}
+
xbolva00 wrote:
> string.data() support?
Yup, there's a lot of API support improvements plan
rnkovacs updated this revision to Diff 148827.
rnkovacs added a comment.
Added a check for `UnknownVal` and two FIXMEs (one for the `OriginExpr` and one
for the new `CheckKind`).
https://reviews.llvm.org/D47135
Files:
include/clang/StaticAnalyzer/Checkers/Checkers.td
lib/StaticAnalyzer/Che
NoQ accepted this revision.
NoQ added a comment.
Looks great, thanks! I think you should add a check for UnknownVal and commit.
Comment at: lib/StaticAnalyzer/Checkers/DanglingInternalBufferChecker.cpp:65
+ if (Call.isCalled(CStrFn)) {
+SymbolRef RawPtr = Call.getReturnVal
xbolva00 added inline comments.
Comment at: lib/StaticAnalyzer/Checkers/DanglingInternalBufferChecker.cpp:33
+public:
+ DanglingInternalBufferChecker() : CStrFn("c_str") {}
+
string.data() support?
https://reviews.llvm.org/D47135
___
rnkovacs added inline comments.
Comment at: lib/StaticAnalyzer/Checkers/MallocChecker.cpp:1661
+ case AF_CXXNewArray:
+ case AF_InternalBuffer: {
if (IsALeakCheck) {
Is tying this new family to NewDeleteChecker reasonable? I did it because it
was NewDelet
xazax.hun accepted this revision.
xazax.hun added a comment.
This revision is now accepted and ready to land.
LGTM!
https://reviews.llvm.org/D47135
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinf
rnkovacs updated this revision to Diff 148732.
rnkovacs added a comment.
Address (most) comments.
https://reviews.llvm.org/D47135
Files:
include/clang/StaticAnalyzer/Checkers/Checkers.td
lib/StaticAnalyzer/Checkers/AllocationState.h
lib/StaticAnalyzer/Checkers/CMakeLists.txt
lib/StaticA
xazax.hun added inline comments.
Comment at: lib/StaticAnalyzer/Checkers/DanglingInternalBufferChecker.cpp:65
+ if (Call.isCalled(CStrFn)) {
+SymbolRef RawPtr = Call.getReturnValue().getAsSymbol();
+State = State->set(TypedR, RawPtr);
xazax.hun wrote:
>
xazax.hun added inline comments.
Comment at: lib/StaticAnalyzer/Checkers/DanglingInternalBufferChecker.cpp:73
+if (State->contains(TypedR)) {
+ const SymbolRef *StrBufferPtr = State->get(TypedR);
+ const Expr *Origin = Call.getOriginExpr();
xazax.hu
xazax.hun added a comment.
Looks good so far, some comments inline.
Comment at: lib/StaticAnalyzer/Checkers/DanglingInternalBufferChecker.cpp:58
+
+ auto *TypeDecl = TypedR->getValueType().getTypePtr()->getAsCXXRecordDecl();
+ if (TypeDecl->getName() != "basic_string")
--
rnkovacs updated this revision to Diff 148727.
rnkovacs retitled this revision from "[analyzer][WIP] A checker for dangling
string pointers in C++" to "[analyzer] A checker for dangling internal buffer
pointers in C++".
rnkovacs edited the summary of this revision.
rnkovacs added a comment.
- Al
14 matches
Mail list logo