{"id":416533,"date":"2024-06-30T01:00:48","date_gmt":"2024-06-30T01:00:48","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=416533"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2024-06-30T01:00:48","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=416533","title":{"rendered":"<span>\u0422\u043e\u043f-10 \u043e\u0448\u0438\u0431\u043e\u043a \u0432 C++ \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 \u0437\u0430 2022 \u0433\u043e\u0434<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0414\u0435\u043b\u043e \u0438\u0434\u0451\u0442 \u043a \u041d\u043e\u0432\u043e\u043c\u0443 \u0433\u043e\u0434\u0443, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442, \u0441\u0430\u043c\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u043e \u0432\u0441\u043f\u043e\u043c\u043d\u0438\u0442\u044c \u0434\u0435\u0441\u044f\u0442\u044c \u0441\u0430\u043c\u044b\u0445 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0445 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u0448\u0451\u043b PVS-Studio \u0432 2022 \u0433\u043e\u0434\u0443.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/post_images\/45d\/353\/267\/45d3532676b6ab64a85fefdefe647551.png\" alt=\"1021_Top_10_CPP_Bugs_2022_ru\/image1.png\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/45d\/353\/267\/45d3532676b6ab64a85fefdefe647551.png\"\/><\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<p>\u0421\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0432 \u044d\u0442\u043e\u043c \u0433\u043e\u0434\u0443 \u0431\u044b\u043b\u043e \u043d\u0435 \u0442\u0430\u043a \u043c\u043d\u043e\u0433\u043e \u0441\u0442\u0430\u0442\u0435\u0439 \u043f\u0440\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432, \u043a\u0430\u043a \u0432 \u043f\u0440\u043e\u0448\u043b\u044b\u0445. \u0421\u0442\u0430\u0442\u044c\u0438 \u0432 \u043d\u0430\u0448\u0435\u043c <a href=\"https:\/\/pvs-studio.com\/ru\/blog\">\u0431\u043b\u043e\u0433\u0435<\/a> \u0441\u0442\u0430\u043b\u0438 \u0440\u0430\u0437\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u0435\u0439, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u044f\u0432\u0438\u043b\u0438\u0441\u044c <a href=\"https:\/\/pvs-studio.com\/ru\/blog\/posts\/?tag=GuestArticle\">\u043f\u0435\u0440\u0435\u0432\u043e\u0434\u044b \u0441\u0442\u0430\u0442\u0435\u0439<\/a> \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0445 \u0430\u0432\u0442\u043e\u0440\u043e\u0432. \u041e\u0434\u043d\u0430\u043a\u043e, \u0443 \u043c\u0435\u043d\u044f, \u043a\u0430\u043a \u0443 \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u0437 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u0435\u0439 \u043d\u0430\u0448\u0435\u0433\u043e \u0431\u043b\u043e\u0433\u0430 (\u0430 \u0442\u0430\u043a\u0436\u0435 <a href=\"https:\/\/pvs-studio.com\/ru\/blog\/posts\/?author=vladislav-stolyarov\">\u0430\u0432\u0442\u043e\u0440\u0430 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u0442\u0430\u0442\u0435\u0439<\/a> \u0438\u0437 \u043d\u0435\u0433\u043e), \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043b\u0441\u044f \u0442\u043e\u043f \u043e\u0448\u0438\u0431\u043e\u043a, \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0445 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u043e\u043c PVS-Studio \u0438 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 \u0432 \u043d\u0430\u0448\u0438\u0445 \u0441\u0442\u0430\u0442\u044c\u044f\u0445 \u043f\u0440\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432. \u041e\u0442\u043c\u0435\u0447\u0443, \u0447\u0442\u043e \u044d\u0442\u043e\u0442 \u0442\u043e\u043f \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0441\u0443\u0431\u044a\u0435\u043a\u0442\u0438\u0432\u043d\u044b\u0439 \u2014 \u0432 \u043d\u0451\u043c \u043c\u043d\u043e\u0433\u043e \u043e\u0448\u0438\u0431\u043e\u043a \u0438\u0437 \u0441\u0442\u0430\u0442\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0438\u0441\u0430\u043b \u044f :). <\/p>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441, \u0443\u0432\u0430\u0436\u0430\u0435\u043c\u044b\u0435 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u0438, \u0435\u0441\u0442\u044c \u0441\u0432\u043e\u0451 \u0432\u0438\u0434\u0435\u043d\u0438\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0434\u043e\u043b\u0436\u0435\u043d \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u044d\u0442\u043e\u0442 \u0442\u043e\u043f, \u0442\u043e \u043f\u0438\u0448\u0438\u0442\u0435 \u043e\u0431 \u044d\u0442\u043e\u043c \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445. \u0418\u0442\u0430\u043a, \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c, \u0432\u0441\u0435\u043c \u043f\u0440\u0438\u044f\u0442\u043d\u043e\u0433\u043e \u0447\u0442\u0435\u043d\u0438\u044f!<\/p>\n<p>  <\/p>\n<h2 id=\"desyatoe-mesto-klassicheskaya-opechatka\">\u0414\u0435\u0441\u044f\u0442\u043e\u0435 \u043c\u0435\u0441\u0442\u043e: \u041a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043e\u043f\u0435\u0447\u0430\u0442\u043a\u0430<\/h2>\n<p>  <\/p>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v501\/\">V501<\/a> [CWE-570] There are identical sub-expressions &#8216;(SrcTy.isPointer() &amp;&amp; DstTy.isScalar())&#8217; to the left and to the right of the &#8216;||&#8217; operator. CallLowering.cpp 1198<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">static bool isCopyCompatibleType(LLT SrcTy, LLT DstTy)  {   if (SrcTy == DstTy)     return true;    if (SrcTy.getSizeInBits() != DstTy.getSizeInBits())     return false;    SrcTy = SrcTy.getScalarType();   DstTy = DstTy.getScalarType();    return (SrcTy.isPointer() &amp;&amp; DstTy.isScalar()) ||          (DstTy.isScalar() &amp;&amp; SrcTy.isPointer()); }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0435 \u043a\u043e\u0434\u0430 \u0434\u043e\u043f\u0443\u0449\u0435\u043d\u0430 \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043e\u043f\u0435\u0447\u0430\u0442\u043a\u0430:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">(SrcTy.isPointer() &amp;&amp; DstTy.isScalar()) || (DstTy.isScalar()  &amp;&amp; SrcTy.isPointer())<\/code><\/pre>\n<p>  <\/p>\n<p>\u041e\u0448\u0438\u0431\u043a\u0430 \u0437\u0434\u0435\u0441\u044c:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">(SrcTy.isPointer() &amp;&amp; DstTy.isScalar()) || (DstTy.isScalar()  &amp;&amp; SrcTy.isPointer())<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u043f\u043e\u043c\u0435\u043d\u044f\u043b \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u0439 \u0441\u0442\u0440\u043e\u0447\u043a\u0435 <em>Src<\/em> \u043d\u0430 <em>Dst<\/em> \u0438 <em>Pointer<\/em> \u043d\u0430 <em>Scalar<\/em>. \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0434\u0432\u0430 \u0440\u0430\u0437\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u043e\u0434\u043d\u043e \u0438 \u0442\u043e \u0436\u0435! \u041a\u043e\u0434 \u0432\u044b\u0448\u0435 \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442\u0435\u043d:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">(SrcTy.isPointer() &amp;&amp; DstTy.isScalar()) || (SrcTy.isPointer() &amp;&amp; DstTy.isScalar())<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">(SrcTy.isPointer() &amp;&amp; DstTy.isScalar()) || (SrcTy.isScalar()  &amp;&amp; DstTy.isPointer())<\/code><\/pre>\n<p>  <\/p>\n<p>\u042d\u0442\u0430 \u043e\u0448\u0438\u0431\u043a\u0430 \u0432\u043e\u0448\u043b\u0430 \u0432 \u0442\u043e\u043f \u0438\u0437 \u0441\u0442\u0430\u0442\u044c\u0438: &#171;<a href=\"https:\/\/pvs-studio.com\/ru\/blog\/posts\/cpp\/1003\/\">\u041f\u0440\u0438\u043c\u0435\u0440\u044b \u043e\u0448\u0438\u0431\u043e\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u0435\u0442 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0442\u044c PVS-Studio \u0432 \u043a\u043e\u0434\u0435 LLVM 15.0<\/a>&#171;.<\/p>\n<p>  <\/p>\n<h2 id=\"devyatoe-mesto-kuda-uzh-bez-vyhoda-za-granicu-konteynera\">\u0414\u0435\u0432\u044f\u0442\u043e\u0435 \u043c\u0435\u0441\u0442\u043e: \u041a\u0443\u0434\u0430 \u0443\u0436 \u0431\u0435\u0437 \u0432\u044b\u0445\u043e\u0434\u0430 \u0437\u0430 \u0433\u0440\u0430\u043d\u0438\u0446\u0443 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430<\/h2>\n<p>  <\/p>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v557\/\">V557<\/a> Array overrun is possible. The &#8216;j&#8217; index is pointing beyond array bound. OgreAnimationTrack.cpp 219<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">void AnimationTrack::_buildKeyFrameIndexMap(   const std::vector&lt;Real>&amp; keyFrameTimes) {    \/\/ ....    size_t i = 0, j = 0;   while (j &lt;= keyFrameTimes.size())                    \/\/ &lt;=   {     mKeyFrameIndexMap[j] = static_cast&lt;ushort>(i);     while (i &lt; mKeyFrames.size()       &amp;&amp; mKeyFrames[i]->getTime() &lt;= keyFrameTimes[j]) \/\/ &lt;=       ++i;     ++j;   } }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0417\u0434\u0435\u0441\u044c \u0438\u043d\u0434\u0435\u043a\u0441 <em>j<\/em>, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 <em>keyFrameTimes<\/em>, \u0438\u043d\u043a\u0440\u0435\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0434\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u0440\u0430\u0432\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0443 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430. \u041f\u043e\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0443 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">while (j &lt; keyFrameTimes.size()) {   \/\/ .... }<\/code><\/pre>\n<p>  <\/p>\n<p>\u042d\u0442\u0430 \u043e\u0448\u0438\u0431\u043a\u0430 \u0432\u043e\u0448\u043b\u0430 \u0432 \u0442\u043e\u043f \u0438\u0437 \u0441\u0442\u0430\u0442\u044c\u0438: &#171;<a href=\"https:\/\/pvs-studio.com\/ru\/blog\/posts\/cpp\/0927\/\">\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 Ogre3D \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u043e\u043c PVS-Studio&#187;<\/a><\/p>\n<p>  <\/p>\n<h2 id=\"vosmoe-mesto-yavnyy-primer-razymenovaniya-nulevogo-ukazatelya\">\u0412\u043e\u0441\u044c\u043c\u043e\u0435 \u043c\u0435\u0441\u0442\u043e: \u042f\u0432\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0443\u043b\u0435\u0432\u043e\u0433\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f<\/h2>\n<p>  <\/p>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v522\/\">V522<\/a> [CERT-EXP34-C] Dereferencing of the null pointer &#8216;document&#8217; might take place. TextBlockCursor.cpp 332<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">auto BlockCursor::begin() -> std::list&lt;TextBlock>::iterator {   return document == nullptr              ? document->blocks.end() : document->blocks.begin(); }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u043e\u043c\u043d\u044e, \u0447\u0442\u043e \u043a\u043e\u0433\u0434\u0430 \u044f \u0432 \u043f\u0435\u0440\u0432\u044b\u0439 \u0440\u0430\u0437 \u0443\u0432\u0438\u0434\u0435\u043b \u0434\u0430\u043d\u043d\u044b\u0439 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430, \u0442\u043e \u0434\u0430\u0436\u0435 \u043d\u0435 \u0443\u0434\u0435\u0440\u0436\u0430\u043b\u0441\u044f \u043e\u0442 \u0444\u0435\u0439\u0441\u043f\u0430\u043b\u043c\u0430. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c\u0441\u044f, \u0447\u0442\u043e \u0442\u0443\u0442 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442: \u043c\u044b \u0432\u0438\u0434\u0438\u043c \u044f\u0432\u043d\u0443\u044e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f <em>document<\/em> \u043d\u0430 <em>nullptr<\/em> \u0438 \u0435\u0433\u043e \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 \u043e\u0431\u043e\u0438\u0445 \u0432\u0435\u0442\u043a\u0430\u0445 \u0442\u0435\u0440\u043d\u0430\u0440\u043d\u043e\u0433\u043e \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430.<\/p>\n<p>  <\/p>\n<p>\u0414\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u0431\u044b\u043b \u0431\u044b \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u0435\u043d \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u0446\u0435\u043b\u044c\u044e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0430 \u0431\u044b\u043b\u043e \u0431\u044b \u0443\u0440\u043e\u043d\u0438\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443.<\/p>\n<p>  <\/p>\n<p>\u042d\u0442\u0430 \u043e\u0448\u0438\u0431\u043a\u0430 \u0432\u043e\u0448\u043b\u0430 \u0432 \u0442\u043e\u043f \u0438\u0437 \u0441\u0442\u0430\u0442\u044c\u0438: &#171;<a href=\"https:\/\/pvs-studio.com\/ru\/blog\/posts\/cpp\/0914\/\">MuditaOS: \u0437\u0430\u0437\u0432\u043e\u043d\u0438\u0442 \u043b\u0438 \u0432\u0430\u0448 \u0431\u0443\u0434\u0438\u043b\u044c\u043d\u0438\u043a? \u0427\u0430\u0441\u0442\u044c 1<\/a>&#171;.<\/p>\n<p>  <\/p>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/pvs-studio-download\/\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/post_images\/04b\/0d5\/022\/04b0d5022b3a6cfadc4732dce7842da7.png\" alt=\"getTrialImageLink\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/04b\/0d5\/022\/04b0d5022b3a6cfadc4732dce7842da7.png\"\/><\/a><\/p>\n<p>  <\/p>\n<h2 id=\"sedmoe-mesto-uchimsya-schitat-do-semi\">\u0421\u0435\u0434\u044c\u043c\u043e\u0435 \u043c\u0435\u0441\u0442\u043e: \u0423\u0447\u0438\u043c\u0441\u044f \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0434\u043e \u0441\u0435\u043c\u0438<\/h2>\n<p>  <\/p>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v557\/\">V557<\/a> [CWE-787] Array overrun is possible. The &#8216;dynamicStateCount ++&#8217; index is pointing beyond array bound. VltGraphics.cpp 157<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">VkPipeline VltGraphicsPipeline::createPipeline(\/* .... *\/) const {   \/\/ ....   std::array&lt;VkDynamicState, 6> dynamicStates;   uint32_t                      dynamicStateCount = 0;   dynamicStates[dynamicStateCount++] = VK_DYNAMIC_STATE_VIEWPORT;   dynamicStates[dynamicStateCount++] = VK_DYNAMIC_STATE_SCISSOR;   if (state.useDynamicDepthBias())     dynamicStates[dynamicStateCount++] = VK_DYNAMIC_STATE_DEPTH_BIAS;   if (state.useDynamicDepthBounds())   {     dynamicStates[dynamicStateCount++] = VK_DYNAMIC_STATE_DEPTH_BOUNDS;     dynamicStates[dynamicStateCount++] =                              VK_DYNAMIC_STATE_DEPTH_BOUNDS_TEST_ENABLE;   }   if (state.useDynamicBlendConstants())     dynamicStates[dynamicStateCount++] = VK_DYNAMIC_STATE_BLEND_CONSTANTS;   if (state.useDynamicStencilRef())     dynamicStates[dynamicStateCount++] = VK_DYNAMIC_STATE_STENCIL_REFERENCE;   \/\/ .... }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0430\u0435\u0442, \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0442\u0438 \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 <em>dynamicStates<\/em>. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0435 \u043a\u043e\u0434\u0430 \u0435\u0441\u0442\u044c 4 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438:<\/p>\n<p>  <\/p>\n<ul>\n<li>if (state.useDynamicDepthBias())<\/li>\n<li>if (state.useDynamicDepthBounds())<\/li>\n<li>if (state.useDynamicBlendConstants())<\/li>\n<li>if (state.useDynamicStencilRef())<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u041a\u0430\u0436\u0434\u0430\u044f \u0438\u0437 \u043d\u0438\u0445 \u2013 \u044d\u0442\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u0437 \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0445 \u0444\u043b\u0430\u0433\u043e\u0432. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 <em>if (state.useDynamicDepthBias())<\/em>:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">bool useDynamicDepthBias() const {   return rs.depthBiasEnable(); }  VkBool32 depthBiasEnable() const {   return VkBool32(m_depthBiasEnable); }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u0432\u0441\u0435 \u044d\u0442\u0438 4 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0438\u0441\u0442\u0438\u043d\u043d\u044b\u043c\u0438 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e. \u0422\u043e\u0433\u0434\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0441\u044f 7 \u0441\u0442\u0440\u043e\u043a \u0432\u0438\u0434\u0430 <em>&#8216;dynamicStates[dynamicStateCount++] = &#8230;.&#8217;<\/em>. \u041d\u0430 \u0441\u0435\u0434\u044c\u043c\u043e\u0439 \u0442\u0430\u043a\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0451\u0442 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043a <em>dynamicStates[6]<\/em>. \u042d\u0442\u043e \u0432\u044b\u0445\u043e\u0434 \u0437\u0430 \u0433\u0440\u0430\u043d\u0438\u0446\u0443 \u043c\u0430\u0441\u0441\u0438\u0432\u0430.<\/p>\n<p>  <\/p>\n<p>\u042d\u0442\u0430 \u043e\u0448\u0438\u0431\u043a\u0430 \u0432\u043e\u0448\u043b\u0430 \u0432 \u0442\u043e\u043f \u0438\u0437 \u0441\u0442\u0430\u0442\u044c\u0438: &#171;<a href=\"https:\/\/pvs-studio.com\/ru\/blog\/posts\/cpp\/0955\/\">\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u044d\u043c\u0443\u043b\u044f\u0442\u043e\u0440 GPCS4, \u0438\u043b\u0438 \u0441\u043c\u043e\u0436\u0435\u043c \u043b\u0438 \u043a\u043e\u0433\u0434\u0430-\u043d\u0438\u0431\u0443\u0434\u044c \u043f\u043e\u0438\u0433\u0440\u0430\u0442\u044c \u0432 &#171;Bloodborne&#187; \u043d\u0430 PC<\/a>&#171;.<\/p>\n<p>  <\/p>\n<h2 id=\"shestoe-mesto-brosok-isklyucheniya-iz-noexcept-funkcii\">\u0428\u0435\u0441\u0442\u043e\u0435 \u043c\u0435\u0441\u0442\u043e: \u0411\u0440\u043e\u0441\u043e\u043a \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0438\u0437 noexcept \u0444\u0443\u043d\u043a\u0446\u0438\u0438<\/h2>\n<p>  <\/p>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v509\/\">V509<\/a> [CERT-DCL57-CPP] The noexcept function &#8216;=&#8217; calls function &#8216;setName&#8217; which can potentially throw an exception. Consider wrapping it in a try..catch block. Device.cpp 48<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">struct Device {   static constexpr auto NameBufferSize = 240;   ....   void setName(const std::string &amp;name)   {     if (name.size() > NameBufferSize)      {         throw std::runtime_error(\"Requested name is bigger than buffer                                    size\");     }     strcpy(this->name.data(), name.c_str());   }   .... }  ....  Devicei &amp;Devicei::operator=(Devicei &amp;&amp;d) noexcept {   setName(d.name.data()); }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0417\u0434\u0435\u0441\u044c \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044e, \u043a\u043e\u0433\u0434\u0430 \u0438\u0437 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043f\u043e\u043c\u0435\u0447\u0435\u043d\u043d\u043e\u0439 \u043a\u0430\u043a <em>noexcept<\/em>, \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u0431\u0440\u043e\u0441\u0430\u044e\u0449\u0430\u044f \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u043e\u043a\u0438\u0434\u0430\u043d\u0438\u044f \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0438\u0437 \u0442\u0435\u043b\u0430 nothrow-\u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432\u044b\u0437\u043e\u0432\u0435\u0442\u0441\u044f <em>std::terminate<\/em>, \u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0430\u0432\u0430\u0440\u0438\u0439\u043d\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u0441\u044f.<\/p>\n<p>  <\/p>\n<p>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c \u0441\u0442\u043e\u0438\u043b\u043e \u043f\u043e\u0434\u0443\u043c\u0430\u0442\u044c \u043e \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u043e\u0431\u0435\u0440\u043d\u0443\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e <em>setName<\/em> \u0432 <em><a href=\"https:\/\/en.cppreference.com\/w\/cpp\/language\/function-try-block\">function-try-block<\/a><\/em> \u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0442\u0430\u043c \u0432\u043e\u0437\u043d\u0438\u043a\u0448\u0443\u044e \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044e \u0438\u043b\u0438 \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043d\u0430 \u0447\u0442\u043e-\u0442\u043e \u0435\u0449\u0451.<\/p>\n<p>  <\/p>\n<p>\u042d\u0442\u0430 \u043e\u0448\u0438\u0431\u043a\u0430 \u0432\u043e\u0448\u043b\u0430 \u0432 \u0442\u043e\u043f \u0438\u0437 \u0441\u0442\u0430\u0442\u044c\u0438: &#171;<a href=\"https:\/\/pvs-studio.com\/ru\/blog\/posts\/cpp\/0914\/\">MuditaOS: \u0437\u0430\u0437\u0432\u043e\u043d\u0438\u0442 \u043b\u0438 \u0432\u0430\u0448 \u0431\u0443\u0434\u0438\u043b\u044c\u043d\u0438\u043a? \u0427\u0430\u0441\u0442\u044c 1<\/a>&#171;.<\/p>\n<p>  <\/p>\n<h2 id=\"pyatoe-mesto-nepravilnaya-rabota-s-dinamicheskoy-pamyatyu\">\u041f\u044f\u0442\u043e\u0435 \u043c\u0435\u0441\u0442\u043e: \u041d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u044c\u044e<\/h2>\n<p>  <\/p>\n<p>\u041d\u0430 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u043d\u0438\u0436\u0435 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430 PVS-Studio \u0432\u044b\u0434\u0430\u043b \u0441\u0440\u0430\u0437\u0443 \u0434\u0432\u0430 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f:<\/p>\n<p>  <\/p>\n<ul>\n<li><a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v611\/\">V611<\/a> [CERT-MEM51-CPP] The memory was allocated using &#8216;new T[]&#8217; operator but was released using the &#8216;delete&#8217; operator. Consider inspecting this code. It&#8217;s probably better to use &#8216;delete [] heightfieldData;&#8217;. PhysicsServerCommandProcessor.cpp 4741<\/li>\n<li><a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v773\/\">V773<\/a> [CERT-MEM31-C, CERT-MEM51-CPP] The function was exited without releasing the &#8216;worldImporter&#8217; pointer. A memory leak is possible. PhysicsServerCommandProcessor.cpp 4742<\/li>\n<\/ul>\n<p>  <\/p>\n<pre><code class=\"cpp\">bool PhysicsServerCommandProcessor::processCreateCollisionShapeCommand(....) {   btMultiBodyWorldImporter* worldImporter = new btMultiBodyWorldImporter(....);   ....   const unsigned char* heightfieldData = 0;   ....   heightfieldData = new unsigned char[width * height * sizeof(btScalar)];   ....   delete heightfieldData;   return ....; }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041d\u0430\u0447\u043d\u0451\u043c \u0441 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f <a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v773\/\">V773<\/a>. \u041f\u0430\u043c\u044f\u0442\u044c \u043f\u043e\u0434 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c <em>worldImporter<\/em> \u0431\u044b\u043b\u0430 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0430 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 <em>new<\/em> \u0438 \u043f\u043e \u0432\u044b\u0445\u043e\u0434\u0443 \u0438\u0437 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043d\u0435 \u0431\u044b\u043b\u0430 \u043e\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0435\u043d\u0430.<\/p>\n<p>  <\/p>\n<p>\u041f\u0435\u0440\u0435\u0439\u0434\u0451\u043c \u043a \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044e <a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v611\/\">V611<\/a> \u0438 \u0431\u0443\u0444\u0435\u0440\u0443 <em>heightfieldData<\/em>. \u0422\u0443\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043e\u0447\u0438\u0441\u0442\u0438\u043b \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u0443\u044e \u043f\u0430\u043c\u044f\u0442\u044c, \u043e\u0434\u043d\u0430\u043a\u043e \u0441\u0434\u0435\u043b\u0430\u043b \u044d\u0442\u043e \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e. \u0412\u043c\u0435\u0441\u0442\u043e \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431 \u043f\u043e\u0437\u0432\u0430\u0442\u044c \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 <em>delete[]<\/em> \u0434\u043b\u044f \u043e\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u0430\u043b\u043b\u043e\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0440\u0430\u043d\u0435\u0435 \u043f\u0430\u043c\u044f\u0442\u0438 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 <em>new[]<\/em>, \u043e\u043d \u043f\u043e\u0437\u0432\u0430\u043b \u043f\u0440\u043e\u0441\u0442\u043e\u0439 <em>delete<\/em>. \u0421\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0443, \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0434 \u044f\u0432\u043d\u043e \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u0442 \u043a \u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u043c\u0443 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044e, \u0432\u043e\u0442 <a href=\"https:\/\/timsong-cpp.github.io\/cppwp\/n4861\/expr.delete#2\">\u0441\u0441\u044b\u043b\u043a\u0430<\/a> \u043d\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u043f\u0443\u043d\u043a\u0442.<\/p>\n<p>  <\/p>\n<p>\u041a \u0441\u043b\u043e\u0432\u0443, \u043f\u0440\u043e \u0442\u043e, \u043f\u043e\u0447\u0435\u043c\u0443 \u043c\u0430\u0441\u0441\u0438\u0432\u044b \u043d\u0443\u0436\u043d\u043e \u0443\u0434\u0430\u043b\u044f\u0442\u044c \u0438\u043c\u0435\u043d\u043d\u043e \u0447\u0435\u0440\u0435\u0437 delete[], \u0438 \u043f\u0440\u043e \u0442\u043e, \u043a\u0430\u043a \u0432\u043e\u043e\u0431\u0449\u0435 \u0432\u0441\u0451 \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432 <a href=\"https:\/\/pvs-studio.com\/ru\/blog\/posts\/cpp\/0973\/\">\u0441\u0442\u0430\u0442\u044c\u0435<\/a> \u043c\u043e\u0435\u0433\u043e \u043a\u043e\u043b\u043b\u0435\u0433\u0438.<\/p>\n<p>  <\/p>\n<p>\u0418\u0442\u0430\u043a, \u0432\u043e\u0442 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">bool PhysicsServerCommandProcessor::processCreateCollisionShapeCommand(....) {   btMultiBodyWorldImporter* worldImporter = new btMultiBodyWorldImporter(....);   ....   const unsigned char* heightfieldData = 0;   ....   heightfieldData = new unsigned char[width * height * sizeof(btScalar)];   ....    delete   worldImporter;   delete[] heightfieldData;   return ....; }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0441 \u0440\u0443\u0447\u043d\u043e\u0439 \u043e\u0447\u0438\u0441\u0442\u043a\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 \u043c\u043e\u0436\u043d\u043e \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c, \u043d\u0430\u043f\u0438\u0441\u0430\u0432 \u043a\u043e\u0434 \u043f\u043e\u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u0435\u0435. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0432 <em><a href=\"https:\/\/en.cppreference.com\/w\/cpp\/memory\/unique_ptr\">std::unique_ptr<\/a><\/em> \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043e\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u0438. \u0422\u0430\u043a\u043e\u0439 \u043a\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u043a\u043e\u0440\u043e\u0447\u0435 \u0438 \u043d\u0430\u0434\u0451\u0436\u043d\u0435\u0435. \u041e\u043d \u0437\u0430\u0449\u0438\u0442\u0438\u0442 \u043e\u0442 \u043e\u0448\u0438\u0431\u043e\u043a \u043d\u0435\u043e\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0451\u043d\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 \u043f\u0440\u0438 \u0434\u043e\u0441\u0440\u043e\u0447\u043d\u043e\u043c \u0432\u044b\u0445\u043e\u0434\u0435 \u0438\u0437 \u0444\u0443\u043d\u043a\u0446\u0438\u0438:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">bool PhysicsServerCommandProcessor::processCreateCollisionShapeCommand(....) {   auto worldImporter = std::make_unique&lt;btMultiBodyWorldImporter> ();   ....   std::unique_ptr&lt;unsigned char[]> heightfieldData;   ....   heightfieldData = std::make_unique_for_overwrite&lt;unsigned char[]>                                 (width * height * sizeof(btScalar));   ....   return ....; }<\/code><\/pre>\n<p>  <\/p>\n<p>\u042d\u0442\u0430 \u043e\u0448\u0438\u0431\u043a\u0430 \u0432\u043e\u0448\u043b\u0430 \u0432 \u0442\u043e\u043f \u0438\u0437 \u0441\u0442\u0430\u0442\u044c\u0438: &#171;<a href=\"https:\/\/pvs-studio.com\/ru\/blog\/posts\/cpp\/0957\/\">\u0412 \u043c\u0438\u0440\u0435 \u0430\u043d\u0442\u0440\u043e\u043f\u043e\u043c\u043e\u0440\u0444\u043d\u044b\u0445 \u0436\u0438\u0432\u043e\u0442\u043d\u044b\u0445: PVS-Studio \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043b Overgrowth<\/a>&#171;.<\/p>\n<p>  <\/p>\n<h2 id=\"chetvyortoe-mesto-sila-symbolic-execution\">\u0427\u0435\u0442\u0432\u0451\u0440\u0442\u043e\u0435 \u043c\u0435\u0441\u0442\u043e: \u0421\u0438\u043b\u0430 Symbolic execution<\/h2>\n<p>  <\/p>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v560\/\">V560<\/a> [CWE-570] A part of conditional expression is always false: DefaultCC == ToCC. SemaType.cpp 7856<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">void Sema::adjustMemberFunctionCC(QualType &amp;T, bool IsStatic, bool IsCtorOrDtor,                                   SourceLocation Loc) {   ....   CallingConv CurCC = FT->getCallConv();   CallingConv ToCC = Context.getDefaultCallingConvention(IsVariadic, !IsStatic);    if (CurCC == ToCC)     return;   ....   CallingConv DefaultCC =      Context.getDefaultCallingConvention(IsVariadic, IsStatic);    if (CurCC != DefaultCC || DefaultCC == ToCC)     return;   .... }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f, \u043f\u043e\u0447\u0435\u043c\u0443 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0440\u0435\u0448\u0438\u043b, \u0447\u0442\u043e \u043f\u0440\u0430\u0432\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u0432\u0441\u0435\u0433\u0434\u0430 \u043b\u043e\u0436\u043d\u0430. \u0414\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u0443\u0431\u0435\u0440\u0451\u043c \u0432\u0441\u0451 \u043b\u0438\u0448\u043d\u0435\u0435 \u0438 \u0437\u0430\u043c\u0435\u043d\u0438\u043c \u0438\u043c\u0435\u043d\u0430:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">A = ....; B = ....; if (A == B) return; C = ....; if (A != C || C == B)<\/code><\/pre>\n<p>  <\/p>\n<p>\u0420\u0430\u0437\u0431\u0435\u0440\u0451\u043c \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u044d\u0442\u043e\u0442 \u043a\u043e\u0434:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u0435\u0441\u0442\u044c 3 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 A, B, C, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0430\u043c \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b;<\/li>\n<li>\u043d\u043e \u043c\u044b \u0437\u043d\u0430\u0435\u043c, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 A == B, \u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432\u044b\u0445\u043e\u0434 \u0438\u0437 \u0444\u0443\u043d\u043a\u0446\u0438\u0438;<\/li>\n<li>\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0435\u0441\u043b\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f, \u0442\u043e A != B;<\/li>\n<li>\u0435\u0441\u043b\u0438 A != C, \u0442\u043e, \u0432 \u0441\u0438\u043b\u0443 <a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%92%D1%8B%D1%87%D0%B8%D1%81%D0%BB%D0%B5%D0%BD%D0%B8%D1%8F_%D0%BF%D0%BE_%D0%BA%D0%BE%D1%80%D0%BE%D1%82%D0%BA%D0%BE%D0%B9_%D1%81%D1%85%D0%B5%D0%BC%D0%B5\">\u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u043f\u043e \u043a\u043e\u0440\u043e\u0442\u043a\u043e\u0439 \u0441\u0445\u0435\u043c\u0435<\/a>, \u043f\u0440\u0430\u0432\u043e\u0435 \u043f\u043e\u0434\u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043d\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442\u0441\u044f;<\/li>\n<li>\u0435\u0441\u043b\u0438 \u043f\u0440\u0430\u0432\u043e\u0435 \u043f\u043e\u0434\u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 &#171;C == B&#187; \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442\u0441\u044f, \u0437\u043d\u0430\u0447\u0438\u0442 A == C;<\/li>\n<li>\u0435\u0441\u043b\u0438 A != B \u0438 A == C, \u0442\u043e \u0421 \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0440\u0430\u0432\u043d\u043e B.<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u042d\u0442\u0430 \u043e\u0448\u0438\u0431\u043a\u0430 \u0432\u043e\u0448\u043b\u0430 \u0432 \u0442\u043e\u043f \u0438\u0437 \u0441\u0442\u0430\u0442\u044c\u0438: &#171;<a href=\"https:\/\/pvs-studio.com\/ru\/blog\/posts\/cpp\/1003\/\">\u041f\u0440\u0438\u043c\u0435\u0440\u044b \u043e\u0448\u0438\u0431\u043e\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u0435\u0442 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0442\u044c PVS-Studio \u0432 \u043a\u043e\u0434\u0435 LLVM 15.0<\/a>&#171;.<\/p>\n<p>  <\/p>\n<h2 id=\"trete-mesto-mmm-kak-my-lyubim-stdoptionalt\">\u0422\u0440\u0435\u0442\u044c\u0435 \u043c\u0435\u0441\u0442\u043e: \u043c\u043c\u043c, \u043a\u0430\u043a \u043c\u044b \u043b\u044e\u0431\u0438\u043c std::optional&lt;T*><\/h2>\n<p>  <\/p>\n<p>\u041f\u0430\u0440\u0430 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430: <\/p>\n<p>  <\/p>\n<ul>\n<li><a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v571\/\">V571<\/a> Recurring check. The &#8216;if (activeInput)&#8217; condition was already verified in line 249. ServiceAudio.cpp 250<\/li>\n<li><a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v547\/\">V547<\/a> Expression &#8216;activeInput&#8217; is always true. ServiceAudio.cpp 250<\/li>\n<\/ul>\n<p>  <\/p>\n<pre><code class=\"cpp\">std::optional&lt;AudioMux::Input *> AudioMux::GetActiveInput();  ....  auto Audio::handleSetVolume(....) -> std::unique_ptr&lt;AudioResponseMessage> {   ....   if (const auto activeInput = audioMux.GetActiveInput(); activeInput)    {     if (activeInput)      {       retCode = activeInput.value()->audio->SetOutputVolume(clampedValue);     }   }   .... }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0418\u0442\u0430\u043a, <em>activeInput<\/em> \u2014 <em>std::optional<\/em> \u043e\u0442 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f \u043d\u0430 <em>AudioMux::Input<\/em>. \u0415\u0441\u043b\u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u043a\u043e\u0434 \u043f\u043e\u0434 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u043c <em>if<\/em>, \u0442\u043e \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0443 \u043d\u0435\u0433\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f-\u0447\u043b\u0435\u043d <em>value.<\/em> \u041e\u043d\u0430 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e \u0432\u0435\u0440\u043d\u0451\u0442 \u043d\u0430\u043c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u0431\u0435\u0437 \u0431\u0440\u043e\u0441\u043a\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f. \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u044b\u0432\u0430\u0435\u0442\u0441\u044f.<\/p>\n<p>  <\/p>\n<p>\u0412\u043e\u0442 \u0442\u043e\u043b\u044c\u043a\u043e\u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u043a\u0430\u043a \u0432\u0430\u043b\u0438\u0434\u043d\u044b\u0439, \u0442\u0430\u043a \u0438 \u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b, \u043d\u0430\u0432\u0435\u0440\u043d\u043e\u0435, \u0438 \u0445\u043e\u0442\u0435\u043b\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0432\u043e \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u043c <em>if<\/em>. \u041c\u043c\u043c, \u044f \u0442\u043e\u0436\u0435 \u043b\u044e\u0431\u043b\u044e \u043e\u0431\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438 \u0438 \u0431\u0443\u043b\u0435\u0432\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 <em>std::optional<\/em>! \u0418 \u043f\u043e\u0442\u043e\u043c \u043d\u0430\u0441\u0442\u0443\u043f\u0430\u0442\u044c \u043d\u0430 \u0433\u0440\u0430\u0431\u043b\u0438 \ud83d\ude42<\/p>\n<p>  <\/p>\n<p>\u0418\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043a\u043e\u0434\u0430:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">std::optional&lt;AudioMux::Input *> AudioMux::GetActiveInput();  ....  auto Audio::handleSetVolume(....) -> std::unique_ptr&lt;AudioResponseMessage> {   ....   if (const auto activeInput = audioMux.GetActiveInput(); activeInput)    {     if (*activeInput)      {       retCode = (*activeInput)->audio->SetOutputVolume(clampedValue);     }   }   ....<\/code><\/pre>\n<p>  <\/p>\n<p>}<\/p>\n<p>  <\/p>\n<p>\u042d\u0442\u0430 \u043e\u0448\u0438\u0431\u043a\u0430 \u0432\u043e\u0448\u043b\u0430 \u0432 \u0442\u043e\u043f \u0438\u0437 \u0441\u0442\u0430\u0442\u044c\u0438: &#171;<a href=\"https:\/\/pvs-studio.com\/ru\/blog\/posts\/cpp\/0914\/\">MuditaOS: \u0437\u0430\u0437\u0432\u043e\u043d\u0438\u0442 \u043b\u0438 \u0432\u0430\u0448 \u0431\u0443\u0434\u0438\u043b\u044c\u043d\u0438\u043a? \u0427\u0430\u0441\u0442\u044c 1<\/a>&#171;.<\/p>\n<p>  <\/p>\n<h2 id=\"vtoroe-mesto-nepravilnoe-ispolzovanie-flaga\">\u0412\u0442\u043e\u0440\u043e\u0435 \u043c\u0435\u0441\u0442\u043e: \u041d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0444\u043b\u0430\u0433\u0430<\/h2>\n<p>  <\/p>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v547\/\">V547<\/a> [CWE-570] Expression &#8216;nOldFlag &amp; VMPF_NOACCESS&#8217; is always false. PlatMemory.cpp 22<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">#define PAGE_NOACCESS           0x01 #define PAGE_READONLY           0x02 #define PAGE_READWRITE          0x04 #define PAGE_EXECUTE            0x10 #define PAGE_EXECUTE_READ       0x20 #define PAGE_EXECUTE_READWRITE  0x40  enum VM_PROTECT_FLAG {   VMPF_NOACCESS  = 0x00000000,   VMPF_CPU_READ  = 0x00000001,   VMPF_CPU_WRITE = 0x00000002,   VMPF_CPU_EXEC  = 0x00000004,   VMPF_CPU_RW    = VMPF_CPU_READ | VMPF_CPU_WRITE,   VMPF_CPU_RWX   = VMPF_CPU_READ | VMPF_CPU_WRITE | VMPF_CPU_EXEC, };  inline uint32_t GetProtectFlag(VM_PROTECT_FLAG nOldFlag) {   uint32_t nNewFlag = 0;   do   {     if (nOldFlag &amp; VMPF_NOACCESS)     {       nNewFlag = PAGE_NOACCESS;       break;     }      if (nOldFlag &amp; VMPF_CPU_READ)     {       nNewFlag = PAGE_READONLY;     }      if (nOldFlag &amp; VMPF_CPU_WRITE)     {       nNewFlag = PAGE_READWRITE;     }      if (nOldFlag &amp; VMPF_CPU_EXEC)     {       nNewFlag = PAGE_EXECUTE_READWRITE;     }    } while (false);   return nNewFlag; }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f <em>GetProtectFlag<\/em> \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u0443\u0435\u0442 \u0444\u043b\u0430\u0433 \u0441 \u043f\u0440\u0430\u0432\u0430\u043c\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0444\u0430\u0439\u043b\u0443 \u0438\u0437 \u043e\u0434\u043d\u043e\u0433\u043e \u0444\u043e\u0440\u043c\u0430\u0442\u0430 \u0432 \u0434\u0440\u0443\u0433\u043e\u0439. \u041e\u0434\u043d\u0430\u043a\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u044d\u0442\u043e \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e. \u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442 \u043d\u0435 \u0443\u0447\u0451\u043b, \u0447\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <em>VMPF_NOACCESS<\/em> \u0440\u0430\u0432\u043d\u043e \u043d\u0443\u043b\u044e. \u0418\u0437-\u0437\u0430 \u044d\u0442\u043e\u0433\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u0435 <em>if (nOldFlag &amp; VMPF_NOACCESS)<\/em> \u0432\u0441\u0435\u0433\u0434\u0430 \u043b\u043e\u0436\u043d\u043e\u0435, \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0432\u0435\u0440\u043d\u0451\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <em>PAGE_NOACCESS<\/em>.<\/p>\n<p>  <\/p>\n<p>\u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0444\u0443\u043d\u043a\u0446\u0438\u044f <em>GetProtectFlag<\/em> \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u0443\u0435\u0442 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0444\u043b\u0430\u0433 <em>VMPF_NOACCESS<\/em>, \u043d\u043e \u0438 \u0434\u0440\u0443\u0433\u0438\u0435. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0444\u043b\u0430\u0433 <em>VMPF_CPU_EXEC<\/em> \u0431\u0443\u0434\u0435\u0442 \u0441\u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d \u0432\u043e \u0444\u043b\u0430\u0433 <em>PAGE_EXECUTE_READWRITE<\/em>.<\/p>\n<p>  <\/p>\n<p>\u041a\u043e\u0433\u0434\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a, \u043f\u0438\u0441\u0430\u0432\u0448\u0438\u0439 \u0441\u0442\u0430\u0442\u044c\u044e, \u0434\u0443\u043c\u0430\u043b, \u043a\u0430\u043a \u044d\u0442\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c, \u043f\u0435\u0440\u0432\u043e\u0439 \u043c\u044b\u0441\u043b\u044c\u044e \u0431\u044b\u043b\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u0432 \u0442\u0430\u043a\u043e\u043c \u0440\u043e\u0434\u0435:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">inline uint32_t GetProtectFlag(VM_PROTECT_FLAG nOldFlag) {   uint32_t nNewFlag = PAGE_NOACCESS;   if (nOldFlag &amp; VMPF_CPU_READ)   {     nNewFlag |= PAGE_READ;   }    if (nOldFlag &amp; VMPF_CPU_WRITE)   {     nNewFlag |= PAGE_WRITE;   }    if (nOldFlag &amp; VMPF_CPU_EXEC)   {     nNewFlag |= PAGE_EXECUTE;   }    return nNewFlag; }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0442\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442. \u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e <em>PAGE_NOACCESS<\/em>, <em>PAGE_READONLY<\/em> \u0438 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u2013 \u044d\u0442\u043e Windows-\u0444\u043b\u0430\u0433\u0438 \u0441\u043e \u0441\u0432\u043e\u0435\u0439 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u043e\u0439. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441\u0440\u0435\u0434\u0438 \u043d\u0438\u0445 \u043d\u0435\u0442 \u0444\u043b\u0430\u0433\u0430 <em>PAGE_WRITE<\/em>. \u0421\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u043f\u0440\u0430\u0432\u0430 \u043d\u0430 \u0437\u0430\u043f\u0438\u0441\u044c, \u0442\u043e, \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c, \u0435\u0441\u0442\u044c \u043f\u0440\u0430\u0432\u0430 \u0435\u0449\u0435 \u0438 \u043d\u0430 \u0447\u0442\u0435\u043d\u0438\u0435. \u041f\u043e \u0442\u0435\u043c \u0436\u0435 \u043f\u0440\u0438\u0447\u0438\u043d\u0430\u043c \u043d\u0435\u0442 \u0444\u043b\u0430\u0433\u0430 <em>PAGE_EXECUTE_WRITE<\/em>.<\/p>\n<p>  <\/p>\n<p>\u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u043f\u043e\u0431\u0438\u0442\u043e\u0432\u043e\u0435 &#171;\u0418\u041b\u0418&#187; \u0434\u0432\u0443\u0445 Windows-\u0444\u043b\u0430\u0433\u043e\u0432 \u043d\u0435 \u0434\u0430\u0451\u0442 \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0444\u043b\u0430\u0433, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0441\u0443\u043c\u043c\u0435 \u043f\u0440\u0430\u0432: <em>PAGE_READONLY | PAGE_EXECUTE != PAGE_EXECUTE_READ<\/em>. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0431\u0438\u0440\u0430\u0442\u044c \u0432\u0441\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u0438 \u0444\u043b\u0430\u0433\u043e\u0432:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">inline uint32_t GetProtectFlag(VM_PROTECT_FLAG nOldFlag) {   switch (nOldFlag)   {     case VMPF_NOACCESS:       return PAGE_NOACCESS;     case VMPF_CPU_READ:       return PAGE_READONLY;     case VMPF_CPU_WRITE: \/\/ same as ReadWrite     case VMPF_CPU_RW:       return PAGE_READWRITE;     case VMPF_CPU_EXEC:       return PAGE_EXECUTE;     case VMPF_CPU_READ | VMPF_CPU_EXEC:       return PAGE_EXECUTE_READ:     case VMPF_CPU_WRITE | VMPF_CPU_EXEC: \/\/ same as ExecuteReadWrite     case VMPF_CPU_RWX:       return PAGE_EXECUTE_READWRITE;     default:       LOG(\"unknown PS4 flag\");       return PAGE_NOACCESS;   } }<\/code><\/pre>\n<p>  <\/p>\n<p>\u042d\u0442\u0430 \u043e\u0448\u0438\u0431\u043a\u0430 \u0432\u043e\u0448\u043b\u0430 \u0432 \u0442\u043e\u043f \u0438\u0437 \u0441\u0442\u0430\u0442\u044c\u0438: &#171;<a href=\"https:\/\/pvs-studio.com\/ru\/blog\/posts\/cpp\/0955\/\">\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u044d\u043c\u0443\u043b\u044f\u0442\u043e\u0440 GPCS4, \u0438\u043b\u0438 \u0441\u043c\u043e\u0436\u0435\u043c \u043b\u0438 \u043a\u043e\u0433\u0434\u0430-\u043d\u0438\u0431\u0443\u0434\u044c \u043f\u043e\u0438\u0433\u0440\u0430\u0442\u044c \u0432 &#171;Bloodborne&#187; \u043d\u0430 PC<\/a>&#171;.<\/p>\n<p>  <\/p>\n<h2 id=\"pervoe-mesto-pvs-studio-zaschischaet-ot-pospeshnyh-pravok-koda\">\u041f\u0435\u0440\u0432\u043e\u0435 \u043c\u0435\u0441\u0442\u043e: PVS-Studio \u0437\u0430\u0449\u0438\u0449\u0430\u0435\u0442 \u043e\u0442 \u043f\u043e\u0441\u043f\u0435\u0448\u043d\u044b\u0445 \u043f\u0440\u0430\u0432\u043e\u043a \u043a\u043e\u0434\u0430!<\/h2>\n<p>  <\/p>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v530\/\">V530<\/a> [CWE-252]: The return value of function &#8216;clamp&#8217; is required to be utilized. BLI_math_vector.hh 88<\/p>\n<p>  <\/p>\n<p>\u0418\u0442\u0430\u043a, \u0436\u0438\u043b-\u0431\u044b\u043b \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0434 \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0432\u0435\u043a\u0442\u043e\u0440\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439. \u0421\u0443\u0442\u044c \u2014 \u043d\u0435 \u0434\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c \u0432\u044b\u0445\u043e\u0434\u0438\u0442\u044c \u0437\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0439 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d.<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">#define CLAMP(a, b, c) \\   { \\     if ((a) &lt; (b)) { \\       (a) = (b); \\     } \\     else if ((a) > (c)) { \\       (a) = (c); \\     } \\   } \\   (void)0  template &lt;typename T> inline T clamp(const T &amp;a, const bT &amp;min_v, const bT &amp;max_v) {   T result = a;   for (int i = 0; i &lt; T::type_length; i++) {     CLAMP(result[i], min_v, max_v);   }   return result; }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0418 \u0431\u044b\u043b\u043e \u0432\u0441\u0451 \u0445\u043e\u0440\u043e\u0448\u043e. \u0410 \u043f\u043e\u0442\u043e\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442 \u0440\u0435\u0448\u0438\u043b, \u0447\u0442\u043e \u043d\u0435\u0442 \u0441\u043c\u044b\u0441\u043b\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0430\u043c\u043e\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043c\u0430\u043a\u0440\u043e\u0441 <em>CLAMP<\/em>, \u0430 \u043b\u0443\u0447\u0448\u0435 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 <em><a href=\"https:\/\/en.cppreference.com\/w\/cpp\/algorithm\/clamp\">std::clamp<\/a><\/em>. \u0418 \u0432 <a href=\"https:\/\/github.com\/blender\/blender\/commit\/399168f3c13fadb41c9fbec8a1b5c56cb6609343\">\u043a\u043e\u043c\u043c\u0438\u0442\u0435<\/a>, \u043f\u0440\u0438\u0437\u0432\u0430\u043d\u043d\u043e\u043c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043c\u0438\u0440 \u043b\u0443\u0447\u0448\u0435, \u043a\u043e\u0434 \u0441\u0442\u0430\u043b \u0442\u0430\u043a\u0438\u043c:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">template &lt;typename T, int Size> inline vec_base&lt;T, Size>   clamp(const vec_base&lt;T, Size> &amp;a, const T &amp;min, const T &amp;max) {   vec_base&lt;T, Size> result = a;   for (int i = 0; i &lt; Size; i++) {     std::clamp(result[i], min, max);   }   return result; }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412\u043e\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0441\u043f\u0435\u0448\u0438\u043b. \u0412\u0438\u0434\u0438\u0442\u0435 \u043e\u0448\u0438\u0431\u043a\u0443? \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0432\u0438\u0434\u0438\u0442\u0435, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043d\u0435\u0442. \u0412 \u043b\u044e\u0431\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442, \u043d\u0430\u043f\u0438\u0441\u0430\u0432\u0448\u0438\u0439 \u044d\u0442\u043e\u0442 \u043a\u043e\u0434, \u044f\u0432\u043d\u043e \u043d\u0435 \u0437\u0430\u043c\u0435\u0442\u0438\u043b, \u0447\u0442\u043e \u043a\u043e\u0434 \u0441\u043b\u043e\u043c\u0430\u043b\u0441\u044f.<\/p>\n<p>  <\/p>\n<p>\u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f <em><a href=\"https:\/\/en.cppreference.com\/w\/cpp\/algorithm\/clamp\">std::clamp<\/a><\/em> \u043d\u0435 \u043c\u0435\u043d\u044f\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">template &lt;class T> constexpr const T&amp; clamp( const T&amp; v, const T&amp; lo, const T&amp; hi );<\/code><\/pre>\n<p>  <\/p>\n<p>\u041c\u0430\u043a\u0440\u043e\u0441 <em>CLAMP<\/em> \u0440\u0430\u043d\u044c\u0448\u0435 \u0438\u0437\u043c\u0435\u043d\u044f\u043b \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u0430 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043d\u0435\u0442. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0442\u0435\u043f\u0435\u0440\u044c \u043a\u043e\u0434 \u0441\u043b\u043e\u043c\u0430\u043d \u0438 \u0436\u0434\u0451\u0442, \u043a\u043e\u0433\u0434\u0430 \u043a\u0442\u043e-\u0442\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442 \u043f\u0440\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u0438 \u043f\u043e\u0439\u0434\u0451\u0442 \u0438\u0441\u043a\u0430\u0442\u044c \u0435\u0451 \u043f\u0440\u0438\u0447\u0438\u043d\u0443.<\/p>\n<p>  <\/p>\n<p>\u041e\u0442\u043c\u0435\u0447\u0443, \u0447\u0442\u043e \u043c\u044b \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f <a href=\"https:\/\/pvs-studio.com\/ru\/blog\/posts\/cpp\/0799\/\">\u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u043e\u0439<\/a> \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u0441 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c. \u0418\u043d\u043e\u0433\u0434\u0430 \u044d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0438\u0441\u0430\u0442\u044c \u043c\u0438\u043d\u0438-\u0437\u0430\u043c\u0435\u0442\u043a\u0438 \u0438 \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0435 \u0431\u0430\u0433\u0438 \u0432 \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0442\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u043c \u043a\u043e\u0434\u0435.<\/p>\n<p>  <\/p>\n<p>\u0423 \u043d\u0430\u0441 \u0443\u0436\u0435 \u043c\u043d\u043e\u0433\u043e \u0441\u0442\u0430\u0442\u0435\u0439 \u0434\u0430\u043d\u043d\u043e\u0439 \u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0438, \u0441\u0435\u0439\u0447\u0430\u0441 \u044f \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0440\u0438\u0432\u0451\u043b \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0441\u0430\u043c\u043e\u0433\u043e \u0437\u0430\u043f\u043e\u043c\u043d\u0438\u0432\u0448\u0435\u0433\u043e\u0441\u044f \u043c\u043d\u0435 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f. \u041a\u0441\u0442\u0430\u0442\u0438, \u0435\u0441\u043b\u0438 \u0432\u044b \u043d\u0435 \u0447\u0438\u0442\u0430\u043b\u0438 \u0438\u0445, \u0442\u043e \u044f \u043d\u0430\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u0432\u0430\u043c \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c!<\/p>\n<p>  <\/p>\n<p>\u042f, \u043a\u0430\u043a \u0430\u0432\u0442\u043e\u0440 \u043f\u043e\u0434\u0431\u043e\u0440\u043a\u0438, \u0445\u043e\u0447\u0443 \u043e\u0442\u0434\u0430\u0442\u044c \u043f\u0435\u0440\u0432\u043e\u0435 \u043c\u0435\u0441\u0442\u043e \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u044d\u0442\u043e\u0439 \u043e\u0448\u0438\u0431\u043a\u0435, \u0430 \u0432\u0441\u0435\u043c\u0443 \u0446\u0438\u043a\u043b\u0443 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0439 \u0434\u0430\u043d\u043d\u043e\u0439 \u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0438. \u041f\u043e \u0441\u0443\u0442\u0438, \u044d\u0442\u043e \u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u043e\u0434\u043d\u043e\u0433\u043e \u043d\u0435\u0431\u0435\u0437\u044b\u0437\u0432\u0435\u0441\u0442\u043d\u043e\u0433\u043e \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0430 (\u0410\u043d\u0434\u0440\u0435\u0439, \u043f\u0440\u0438\u0432\u0435\u0442!), \u043f\u043e\u043b\u043e\u0436\u0438\u0432\u0448\u0430\u044f \u043d\u0430\u0447\u0430\u043b\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u043c\u0443 \u0436\u0430\u043d\u0440\u0443 \u0441\u0442\u0430\u0442\u0435\u0439 \u043d\u0430\u0448\u0435\u0433\u043e \u0431\u043b\u043e\u0433\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0440\u0430\u0434\u043e\u0432\u0430\u043b\u0438 \u043d\u0430\u0441 \u0432\u0435\u0441\u044c 2022 \u0433\u043e\u0434.<\/p>\n<p>  <\/p>\n<ol>\n<li><a href=\"https:\/\/pvs-studio.com\/ru\/blog\/posts\/cpp\/1001\/\">\u041a\u0430\u043a PVS-Studio \u0437\u0430\u0449\u0438\u0449\u0430\u0435\u0442 \u043e\u0442 \u043f\u043e\u0441\u043f\u0435\u0448\u043d\u044b\u0445 \u043f\u0440\u0430\u0432\u043e\u043a \u043a\u043e\u0434\u0430, \u043f\u0440\u0438\u043c\u0435\u0440 N6<\/a>. <\/li>\n<li><a href=\"https:\/\/pvs-studio.com\/ru\/blog\/posts\/cpp\/0936\/\">\u041a\u0430\u043a PVS-Studio \u0437\u0430\u0449\u0438\u0449\u0430\u0435\u0442 \u043e\u0442 \u043f\u043e\u0441\u043f\u0435\u0448\u043d\u044b\u0445 \u043f\u0440\u0430\u0432\u043e\u043a \u043a\u043e\u0434\u0430, \u043f\u0440\u0438\u043c\u0435\u0440 N5<\/a>. <\/li>\n<li><a href=\"https:\/\/pvs-studio.com\/ru\/blog\/posts\/cpp\/0924\/\">\u041a\u0430\u043a PVS-Studio \u0437\u0430\u0449\u0438\u0449\u0430\u0435\u0442 \u043e\u0442 \u043f\u043e\u0441\u043f\u0435\u0448\u043d\u044b\u0445 \u043f\u0440\u0430\u0432\u043e\u043a \u043a\u043e\u0434\u0430, \u043f\u0440\u0438\u043c\u0435\u0440 N4<\/a>. <\/li>\n<li><a href=\"https:\/\/pvs-studio.com\/ru\/blog\/posts\/cpp\/0922\/\">\u041a\u0430\u043a PVS-Studio \u0437\u0430\u0449\u0438\u0449\u0430\u0435\u0442 \u043e\u0442 \u043f\u043e\u0441\u043f\u0435\u0448\u043d\u044b\u0445 \u043f\u0440\u0430\u0432\u043e\u043a \u043a\u043e\u0434\u0430, \u043f\u0440\u0438\u043c\u0435\u0440 N3<\/a>. <\/li>\n<li><a href=\"https:\/\/pvs-studio.com\/ru\/blog\/posts\/cpp\/0910\/\">\u041a\u0430\u043a PVS-Studio \u0437\u0430\u0449\u0438\u0449\u0430\u0435\u0442 \u043e\u0442 \u043f\u043e\u0441\u043f\u0435\u0448\u043d\u044b\u0445 \u043f\u0440\u0430\u0432\u043e\u043a \u043a\u043e\u0434\u0430, \u043f\u0440\u0438\u043c\u0435\u0440 N2<\/a>. <\/li>\n<li><a href=\"https:\/\/pvs-studio.com\/ru\/blog\/posts\/cpp\/0817\/\">\u041a\u0430\u043a PVS-Studio \u0437\u0430\u0449\u0438\u0449\u0430\u0435\u0442 \u043e\u0442 \u043f\u043e\u0441\u043f\u0435\u0448\u043d\u044b\u0445 \u043f\u0440\u0430\u0432\u043e\u043a \u043a\u043e\u0434\u0430<\/a>.<\/li>\n<li><a href=\"https:\/\/pvs-studio.com\/ru\/blog\/posts\/cpp\/1004\/\">0, 1, 2, \u0424\u0440\u0435\u0434\u0434\u0438 \u0437\u0430\u0431\u0440\u0430\u043b Blender<\/a><\/li>\n<\/ol>\n<p>  <\/p>\n<p>\u042d\u0442\u0430 \u0436\u0435 \u043e\u0448\u0438\u0431\u043a\u0430 \u0432\u043e\u0448\u043b\u0430 \u0432 \u0442\u043e\u043f \u0438\u0437 \u0441\u0442\u0430\u0442\u044c\u0438: &#171;<a href=\"https:\/\/pvs-studio.com\/ru\/blog\/posts\/cpp\/0924\/\">\u041a\u0430\u043a PVS-Studio \u0437\u0430\u0449\u0438\u0449\u0430\u0435\u0442 \u043e\u0442 \u043f\u043e\u0441\u043f\u0435\u0448\u043d\u044b\u0445 \u043f\u0440\u0430\u0432\u043e\u043a \u043a\u043e\u0434\u0430, \u043f\u0440\u0438\u043c\u0435\u0440 N4<\/a>&#171;.<\/p>\n<p>  <\/p>\n<h2 id=\"zaklyuchenie\">\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>  <\/p>\n<p>\u042d\u0442\u043e\u0442 \u0433\u043e\u0434 \u0432\u044b\u0448\u0435\u043b \u043d\u0435 \u0442\u0430\u043a\u0438\u043c \u043f\u043b\u043e\u0434\u043e\u0442\u0432\u043e\u0440\u043d\u044b\u043c \u043d\u0430 \u0441\u0442\u0430\u0442\u044c\u0438 \u043f\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0435 C++ \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432, \u043a\u0430\u043a \u043f\u0440\u043e\u0448\u043b\u044b\u0435. \u041e\u0434\u043d\u0430\u043a\u043e, \u044f \u043d\u0430\u0434\u0435\u044e\u0441\u044c, \u0447\u0442\u043e \u043c\u044b \u0432\u0441\u0451 \u0436\u0435 \u0441\u043c\u043e\u0433\u043b\u0438 \u043f\u043e\u0440\u0430\u0434\u043e\u0432\u0430\u0442\u044c \u0432\u0430\u0441 \u043f\u043e\u0434\u0431\u043e\u0440\u043a\u043e\u0439 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0445 \u043e\u0448\u0438\u0431\u043e\u043a. \u0422\u0430\u043a\u0436\u0435 \u0432 \u044d\u0442\u043e\u043c \u0433\u043e\u0434\u0443 \u043c\u044b \u043f\u0438\u0441\u0430\u043b\u0438 \u043c\u043d\u043e\u0433\u043e \u0441\u0442\u0430\u0442\u0435\u0439 \u0434\u0440\u0443\u0433\u0438\u0445 \u0436\u0430\u043d\u0440\u043e\u0432, \u043d\u0430\u0439\u0442\u0438 \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u0443 \u043d\u0430\u0441 \u0432 <a href=\"https:\/\/pvs-studio.com\/ru\/blog\/posts\/cpp\/\">\u0431\u043b\u043e\u0433\u0435<\/a>.<\/p>\n<p>  <\/p>\n<p>\u041f\u0438\u0441\u0430\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u043d\u043e\u0432\u043e\u0433\u043e\u0434\u043d\u0438\u0435 \u0441\u0442\u0430\u0442\u044c\u0438 \u0443\u0436\u0435 \u0441\u0442\u0430\u043b\u043e \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u0435\u0439, \u0438 \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0432\u0430\u0448\u0435\u043c\u0443 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044e \u0441\u0442\u0430\u0442\u044c\u0438 \u0441 \u0442\u043e\u043f-10 \u043e\u0448\u0438\u0431\u043e\u043a \u0432 C \u0438 C++ \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 \u043f\u0440\u043e\u0448\u043b\u044b\u0445 \u043b\u0435\u0442: <a href=\"https:\/\/pvs-studio.com\/ru\/blog\/posts\/cpp\/0483\/\">2016<\/a>, <a href=\"https:\/\/pvs-studio.com\/ru\/blog\/posts\/cpp\/0565\/\">2017<\/a>, <a href=\"https:\/\/pvs-studio.com\/ru\/blog\/posts\/cpp\/0619\/\">2018<\/a>, <a href=\"https:\/\/pvs-studio.com\/ru\/blog\/posts\/cpp\/0700\/\">2019<\/a>, <a href=\"https:\/\/pvs-studio.com\/ru\/blog\/posts\/cpp\/0784\/\">2020<\/a>, <a href=\"https:\/\/pvs-studio.com\/ru\/blog\/posts\/cpp\/0901\/\">2021<\/a>.  <\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/708448\/\"> https:\/\/habr.com\/ru\/articles\/708448\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0414\u0435\u043b\u043e \u0438\u0434\u0451\u0442 \u043a \u041d\u043e\u0432\u043e\u043c\u0443 \u0433\u043e\u0434\u0443, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442, \u0441\u0430\u043c\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u043e \u0432\u0441\u043f\u043e\u043c\u043d\u0438\u0442\u044c \u0434\u0435\u0441\u044f\u0442\u044c \u0441\u0430\u043c\u044b\u0445 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0445 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u0448\u0451\u043b PVS-Studio \u0432 2022 \u0433\u043e\u0434\u0443.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/post_images\/45d\/353\/267\/45d3532676b6ab64a85fefdefe647551.png\" alt=\"1021_Top_10_CPP_Bugs_2022_ru\/image1.png\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/45d\/353\/267\/45d3532676b6ab64a85fefdefe647551.png\"\/><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-416533","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/416533","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=416533"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/416533\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=416533"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=416533"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=416533"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}