Following the discussion at D49360.
Added two more test cases that show "returning"-type-of notes as well.
Details
Details
Diff Detail
Diff Detail
Event Timeline
lib/StaticAnalyzer/Checkers/DanglingInternalBufferChecker.cpp | ||
---|---|---|
253 ↗ | (On Diff #156366) | dyn_cast may fail by returning a null pointer. This either needs to be changed to cast or there needs to be a check for a null pointer before use. I guess it should be a cast because you're only acting on typed regions in the checker itself. |
lib/StaticAnalyzer/Checkers/MallocChecker.cpp | ||
2964–2965 | Cool stuff! | |
test/Analysis/dangling-internal-buffer.cpp | ||
63 ↗ | (On Diff #156366) | Mm, nono, there's no return statement here, so we shouldn't say that our pointer is returned to the caller. Whether it should say "returned to the caller" or not, should not depend on the allocation family, but on the kind of "use" we encounter "after" "free". |
75 ↗ | (On Diff #156366) | I suggest a shorter on a 'std::string' instead of on 'std::string' object. |
lib/StaticAnalyzer/Checkers/DanglingInternalBufferChecker.cpp | ||
---|---|---|
253 ↗ | (On Diff #156366) | I hope that in a few more reviews I'll learn to use all of these properly. |
lib/StaticAnalyzer/Checkers/MallocChecker.cpp | ||
2964–2965 | :) | |
test/Analysis/dangling-internal-buffer.cpp | ||
63 ↗ | (On Diff #156366) | I don't even know how this went so off, sorry. |
Cool stuff!