Skip to content

Commit 862b93a

Browse files
committed
[analyzer][docs] Add CSA release notes
We'll soon branch off, and start releasing clang-17. Here is a patch, adjusting the release notes for what we achieved since the last release. I used this command to inspect the interesting commits: ``` git log --oneline llvmorg-16.0.0..llvm/main \ clang/{lib/StaticAnalyzer,include/clang/StaticAnalyzer} | \ grep -v NFC | grep -v -i revert ``` This filters in CSA directories and filters out NFC and revert commits. Given that in the release-notes, we usually don't put links to commits, I'll remove them from this patch as well. I just put them there to make it easier to review for you. I tried to group the changes into meaningful chunks, and dropped some of the uninteresting commits. I've also dropped the commits that were backported to clang-16. Check out how it looks, and propose changes like usual. --- FYI the `ninja docs-clang-html` produces the html docs, including the `ReleaseNotes`. And the produced artifact will be at `build/tools/clang/docs/html/ReleaseNotes.html`. Differential Revision: https://reviews.llvm.org/D155445
1 parent 74d16b2 commit 862b93a

File tree

1 file changed

+63
-0
lines changed

1 file changed

+63
-0
lines changed

clang/docs/ReleaseNotes.rst

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1002,10 +1002,73 @@ libclang
10021002

10031003
Static Analyzer
10041004
---------------
1005+
10051006
- Fix incorrect alignment attribute on the this parameter of certain
10061007
non-complete destructors when using the Microsoft ABI.
10071008
(`#60465 <https://github.com/llvm/llvm-project/issues/60465>`_)
10081009

1010+
- Removed the deprecated
1011+
``consider-single-element-arrays-as-flexible-array-members`` analyzer option.
1012+
Any use of this flag will result in an error.
1013+
Use `-fstrict-flex-arrays=<n>
1014+
<https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-fstrict-flex-arrays>`_
1015+
1016+
- Better modeling of lifetime-extended memory regions. As a result, the
1017+
``MoveChecker`` raises more true-positive reports.
1018+
1019+
- Fixed some bugs (including crashes) around the handling of constant global
1020+
arrays and their initializer expressions.
1021+
1022+
- The ``CStringChecker`` will invalidate less if the copy operation is
1023+
inferable to be bounded. For example, if the arguments of ``strcpy`` are
1024+
known to be of certain lengths and that are in-bounds.
1025+
1026+
.. code-block:: c++
1027+
1028+
struct {
1029+
void *ptr;
1030+
char arr[4];
1031+
} x;
1032+
x.ptr = malloc(1);
1033+
// extent of 'arr' is 4, and writing "hi\n" (4 characters),
1034+
// thus no buffer overflow can happen
1035+
strcpy(x.arr, "hi\n");
1036+
free(x.ptr); // no longer reports memory leak here
1037+
1038+
Similarly, functions like ``strsep`` now won't invalidate the object
1039+
containing the destination buffer, because it can never overflow.
1040+
Note that, ``std::copy`` is still not modeled, and as such, it will still
1041+
invalidate the enclosing object on call.
1042+
(`#55019 <https://github.com/llvm/llvm-project/issues/55019>`_)
1043+
1044+
- Implement ``BufferOverlap`` check for ``sprint``/``snprintf``
1045+
The ``CStringChecker`` checks for buffer overlaps for ``sprintf`` and
1046+
``snprintf``.
1047+
1048+
- Objective-C support was improved around checking ``_Nonnull`` and
1049+
``_Nullable`` including block pointers and literal objects.
1050+
1051+
- Let the ``StreamChecker`` detect ``NULL`` streams instead of by
1052+
``StdCLibraryFunctions``.
1053+
``StreamChecker`` improved on the ``fseek`` modeling for the ``SEEK_SET``,
1054+
``SEEK_END``, ``SEEK_CUR`` arguments.
1055+
1056+
- ``StdCLibraryFunctionArgs`` was merged into the ``StdCLibraryFunctions``.
1057+
The diagnostics of the ``StdCLibraryFunctions`` was improved.
1058+
1059+
- ``QTimer::singleShot`` now doesn't raise false-positives for memory leaks by
1060+
the ``MallocChecker``.
1061+
(`#39713 <https://github.com/llvm/llvm-project/issues/39713>`_)
1062+
1063+
- Fixed the infamous unsigned index false-positives in the
1064+
``ArrayBoundCheckerV2`` checker.
1065+
(`#44493 <https://github.com/llvm/llvm-project/issues/44493>`_)
1066+
1067+
- Now, taint propagations are tracked further back until the real taint source.
1068+
This improves all taint-related diagnostics.
1069+
1070+
- Fixed a null-pointer dereference crash inside the ``MoveChecker``.
1071+
10091072
.. _release-notes-sanitizers:
10101073

10111074
Sanitizers

0 commit comments

Comments
 (0)