Skip to content

Commit c2ddaaa

Browse files
authored
[NFC][analyzer] Add missing documentation for decodeValueOfObjCType (#167822)
This check is introduced in b284005, but the documentation seems missing from `checkers.rst`.
1 parent 3ee54a6 commit c2ddaaa

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

clang/docs/analyzer/checkers.rst

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ as error. Specifically on x86/x86-64 target if the pointer address space is
198198
dereference is not defined as error. See `X86/X86-64 Language Extensions
199199
<https://clang.llvm.org/docs/LanguageExtensions.html#memory-references-to-specified-segments>`__
200200
for reference.
201-
201+
202202
If the analyzer option ``suppress-dereferences-from-any-address-space`` is set
203203
to true (the default value), then this checker never reports dereference of
204204
pointers with a specified address space. If the option is set to false, then
@@ -1664,6 +1664,23 @@ Warn on uses of the 'bzero' function.
16641664
bzero(ptr, n); // warn
16651665
}
16661666
1667+
.. _security-insecureAPI-decodeValueOfObjCType:
1668+
1669+
security.insecureAPI.decodeValueOfObjCType (C)
1670+
""""""""""""""""""""""""""""""""""""""""""""""
1671+
Warn on uses of the Objective-C method ``-decodeValueOfObjCType:at:``.
1672+
1673+
.. code-block:: objc
1674+
1675+
void test(NSCoder *decoder) {
1676+
unsigned int x;
1677+
[decoder decodeValueOfObjCType:"I" at:&x]; // warn
1678+
}
1679+
1680+
This diagnostic is emitted only on Apple platforms where the safer
1681+
``-decodeValueOfObjCType:at:size:`` alternative is available
1682+
(iOS 11+, macOS 10.13+, tvOS 11+, watchOS 4.0+).
1683+
16671684
.. _security-insecureAPI-getpw:
16681685
16691686
security.insecureAPI.getpw (C)

0 commit comments

Comments
 (0)