{"id":446691,"date":"2025-01-31T21:03:01","date_gmt":"2025-01-31T21:03:01","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=446691"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2025-01-31T21:03:01","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=446691","title":{"rendered":"<span>PPSSPP \u0438\u043b\u0438 \u0432\u0441\u0451 \u0436\u0435 psp? \u0421\u043c\u043e\u0442\u0440\u0438\u043c \u0431\u0430\u0433\u0438 \u0432 \u043a\u043e\u0434\u0435 \u0438\u0437 \u043f\u0440\u043e\u0448\u043b\u043e\u0433\u043e<\/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-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412 \u043c\u0438\u0440\u0435 \u0432\u0438\u0434\u0435\u043e\u0438\u0433\u0440 \u044d\u043c\u0443\u043b\u044f\u0442\u043e\u0440\u044b \u0441\u0442\u0430\u043b\u0438 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u0439 \u043d\u0430\u0445\u043e\u0434\u043a\u043e\u0439 \u0434\u043b\u044f \u043f\u043e\u043a\u043b\u043e\u043d\u043d\u0438\u043a\u043e\u0432 \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432. PPSSPP \u2014 \u043e\u0434\u0438\u043d \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u044d\u043c\u0443\u043b\u044f\u0442\u043e\u0440\u043e\u0432 \u0434\u043b\u044f PlayStation Portable (PSP), \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043d\u0430\u043c \u0432\u043d\u043e\u0432\u044c \u043e\u043a\u0443\u043d\u0443\u0442\u044c\u0441\u044f \u0432 \u0430\u0442\u043c\u043e\u0441\u0444\u0435\u0440\u0443 \u043b\u044e\u0431\u0438\u043c\u044b\u0445 \u0438\u0433\u0440, \u043d\u043e \u0443\u0436\u0435 \u043d\u0430 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u0445. \u041e\u0434\u043d\u0430\u043a\u043e \u0447\u0442\u043e\u0431\u044b \u0438\u0433\u0440\u0430\u0442\u044c \u0431\u0435\u0437 \u0441\u0431\u043e\u0435\u0432 \u0438 \u043b\u0430\u0433\u043e\u0432, \u043d\u0443\u0436\u043d\u043e \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u043a\u043e\u0434 \u044d\u043c\u0443\u043b\u044f\u0442\u043e\u0440\u0430 \u0445\u043e\u0440\u043e\u0448\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d.<\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/017\/297\/5ee\/0172975ee09f49deb319dbb2efe78fc2.png\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/\/post_images\/017\/297\/5ee\/0172975ee09f49deb319dbb2efe78fc2.png\"\/><\/figure>\n<h3>\u041f\u0440\u0435\u0434\u0438\u0441\u043b\u043e\u0432\u0438\u0435<\/h3>\n<p>\u042d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0438\u043a\u0432\u0435\u043b\u043e\u043c \u0432\u043e\u0442 \u044d\u0442\u043e\u0439 <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/cpp\/1167\/\">\u0441\u0442\u0430\u0442\u044c\u0438<\/a>. \u0425\u043e\u0447\u0435\u0442\u0441\u044f \u043f\u043e\u0445\u0432\u0430\u043b\u0438\u0442\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 PPSSPP, \u0442\u0430\u043a \u043a\u0430\u043a \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0412\u0421\u0415 \u043e\u0448\u0438\u0431\u043a\u0438 \u0438\u0437 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0447\u0430\u0441\u0442\u0438, \u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043b, \u0431\u044b\u043b\u0438 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u044b \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0435 \u043c\u0435\u0441\u044f\u0446\u0430 \u0438 \u0432 \u0440\u0435\u043b\u0438\u0437 <a href=\"https:\/\/github.com\/hrydgard\/ppsspp\/tree\/v1.18.1\">1.18.1<\/a> \u043d\u0435 \u0432\u043e\u0448\u043b\u0438. \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u0432\u0441\u0435 \u043e\u0448\u0438\u0431\u043a\u0438, \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0435 \u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0438, \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u0442\u044c \u043c\u043d\u0435 \u043d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0438\u0437-\u0437\u0430 \u043d\u0435\u0445\u0432\u0430\u0442\u043a\u0438 \u0441\u0438\u043b \u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u0438. \u041a\u0430\u044e\u0441\u044c. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u0448\u0438\u0431\u043a\u0438, \u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u0438\u0448\u0443 \u0441\u0435\u0433\u043e\u0434\u043d\u044f, \u0432\u0441\u0451 \u0442\u0430\u043a \u0436\u0435 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0432 \u043a\u043e\u0434\u043e\u0432\u043e\u0439 \u0431\u0430\u0437\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \ud83d\ude42<\/p>\n<p>\u041e\u0448\u0438\u0431\u043e\u043a \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435, \u043a\u0430\u043a \u0438 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438, \u043c\u043e\u0433\u043b\u043e \u0431\u044b \u043d\u0435 \u0431\u044b\u0442\u044c, \u0435\u0441\u043b\u0438 \u0431\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438\u0441\u044c PVS-Studio. \u041a \u0441\u043b\u043e\u0432\u0443, \u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u044d\u0442\u043e \u0445\u043e\u0440\u043e\u0448\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u043e\u043c\u043d\u0438\u0442\u044c \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0432 PVS-Studio \u0435\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u0443\u044e \u043b\u0438\u0446\u0435\u043d\u0437\u0438\u044e \u0434\u043b\u044f open source \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e\u0431 \u044d\u0442\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u043d\u0430 <a href=\"https:\/\/pvs-studio.ru\/ru\/order\/open-source-license\/\">\u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435<\/a>.<\/p>\n<h3>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438<\/h3>\n<p>\u041a\u0430\u043a \u044f \u0443\u0436\u0435 \u0441\u043a\u0430\u0437\u0430\u043b \u0432\u044b\u0448\u0435, \u044d\u0442\u043e \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u0435 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u0448\u0438\u0431\u043a\u0438 \u043d\u0430\u0439\u0434\u0435\u043d\u044b \u043f\u0440\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0435 \u043a\u043e\u0434\u0430 PPSSPP \u0432\u0435\u0440\u0441\u0438\u0438 <a href=\"https:\/\/github.com\/hrydgard\/ppsspp\/tree\/v1.17.1\">1.17.1<\/a> \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 <a href=\"https:\/\/pvs-studio.ru\/ru\/\">PVS-Studio<\/a> \u043d\u0430 <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/manual\/6615\/\">Linux<\/a>. \u0412\u0435\u0440\u0441\u0438\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 \u2014 <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/manual\/0010\/#ID713ED1F05C\">7.32<\/a>. \u041d\u043e \u044d\u0442\u0438 \u043e\u0448\u0438\u0431\u043a\u0438 \u043f\u043e\u043f\u0430\u043b\u0438 \u0432 \u0440\u0435\u043b\u0438\u0437 1.18.1, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u0441\u0435 \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u0432 \u043a\u043e\u0434\u0435 \u043d\u0438\u0436\u0435 \u0432\u0435\u0434\u0443\u0442 \u043d\u0430 \u0432\u0435\u0440\u0441\u0438\u044e 1.18.1. \u0422\u0430\u043a\u0436\u0435 \u043e\u0442\u043c\u0435\u0447\u0443, \u0447\u0442\u043e \u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 PVS-Studio \u2014 7.34. \u041e\u0431 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u0445 \u0432 \u044d\u0442\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/manual\/0010\/#ID16CD252F62\">\u0442\u0443\u0442<\/a>.<\/p>\n<h4>Undefined behavior<\/h4>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N1<\/strong><\/p>\n<p>\u0410 \u043d\u0430\u0447\u043d\u0451\u043c \u043c\u044b \u0441 \u0442\u0430\u043a\u043e\u0433\u043e \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430:<\/p>\n<pre><code class=\"cpp\">static int sceNetAdhocctlGetAddrByName(const char *nickName,                                        u32 sizeAddr, u32 bufAddr) {   ....   \/\/ Copied to null-terminated var to prevent unexpected behaviour on Logs   memcpy(nckName, nickName, ADHOCCTL_NICKNAME_LEN);     ....   if (netAdhocctlInited)   {     \/\/ Valid Arguments     if (nickName != NULL &amp;&amp; buflen != NULL)     {       ....     }     ....   } } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V595 The &#8216;nickName&#8217; pointer was utilized before it was verified against nullptr. Check lines: 6143, 6152. sceNetAdhoc.cpp <a href=\"https:\/\/github.com\/hrydgard\/ppsspp\/blob\/0f50225f8e741c2f8a3a35cfd3b7d9dd0a16b34f\/Core\/HLE\/sceNetAdhoc.cpp#L6143\">6143<\/a><\/p>\n<p>\u041a\u0430\u043a \u043c\u044b \u0432\u0438\u0434\u0438\u043c, \u0432 <code>memcpy<\/code> \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442\u0441\u044f \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c <code>nickname<\/code> \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u0431\u0443\u0444\u0435\u0440\u0430. \u0427\u0443\u0442\u044c \u043d\u0438\u0436\u0435 \u043f\u043e \u043a\u043e\u0434\u0443 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f, \u043d\u0435 \u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u043b\u0438 \u044d\u0442\u043e\u0442 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c. \u0417\u043d\u0430\u0447\u0438\u0442, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442, \u0447\u0442\u043e \u0444\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0443\u043b\u0435\u0432\u044b\u043c. \u0417\u0430 \u0442\u043e\u0447\u043a\u0430\u043c\u0438, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u044f \u0441\u043a\u0440\u044b\u043b \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u044b\u0439 \u043a\u043e\u0434, \u043e\u043d \u0442\u043e\u0436\u0435 \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f (\u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u0442\u043a\u043d\u0443\u0432 \u043d\u0430 \u043d\u043e\u043c\u0435\u0440 \u0441\u0442\u0440\u043e\u043a\u0438 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f).<\/p>\n<p>\u0410 \u0447\u0442\u043e \u043f\u043e \u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u0432\u043e\u0434\u0443 \u0434\u0443\u043c\u0430\u0435\u0442 <code>memcpy<\/code>? \u0426\u0438\u0442\u0438\u0440\u0443\u044e <a href=\"https:\/\/en.cppreference.com\/w\/cpp\/string\/byte\/memcpy\">cpperefence<\/a>:<\/p>\n<blockquote>\n<p>If either dest or src is an invalid or null pointer, the behavior is undefined, even if count is zero.<\/p>\n<\/blockquote>\n<p>\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0435:<\/p>\n<ul>\n<li>\n<p>V595 The &#8216;buf2&#8217; pointer was utilized before it was verified against nullptr. Check lines: 364, 365.  __sceAudio.cpp 364<\/p>\n<\/li>\n<\/ul>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N2<\/strong><\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442:<\/p>\n<pre><code class=\"cpp\">int internal_profiler_find_cat(const char *category_name, bool create_missing) {   int i;   for (i = 0; i &lt; MAX_CATEGORIES; i++)   {     const char *catname = categories[i].name;     if (!catname)       break; #ifdef UNIFIED_CONST_STR     if (catname == category_name)     { #else     if (!strcmp(catname, category_name))                          \/\/ &lt;=     { #endif       return i;     }   }    if (i &lt; MAX_CATEGORIES &amp;&amp; category_name &amp;&amp; create_missing)      \/\/ &lt;=   {     ....   }      } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V595 The &#8216;category_name&#8217; pointer was utilized before it was verified against nullptr. Check lines: 103, 109. Profiler.cpp <a href=\"https:\/\/github.com\/hrydgard\/ppsspp\/blob\/0f50225f8e741c2f8a3a35cfd3b7d9dd0a16b34f\/Common\/Profiler\/Profiler.cpp#L103\">103<\/a><\/p>\n<p>\u0423 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f <code>category_name<\/code>, \u043d\u043e \u0441\u0445\u043e\u0434\u0443 \u043c\u043e\u0436\u043d\u043e \u043d\u0435 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0433\u0434\u0435 \u043e\u043d \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f.<\/p>\n<p>\u0412 \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u043d\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0430 \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u0430 <code>UNIFIED_CONST_STR<\/code>, \u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c <code>category_name<\/code> \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u043b\u0435\u0442\u0435\u0442\u044c \u0432 <code>strcmp<\/code>. \u0410 \u044d\u0442\u043e <a href=\"https:\/\/en.cppreference.com\/w\/cpp\/string\/byte\/strcmp#:~:text=The%20behavior%20is,null%2Dterminated%20strings.\">\u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442<\/a> \u043a UB.<\/p>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N3<\/strong><\/p>\n<pre><code class=\"cpp\">static void __GameModeNotify(u64 userdata, int cyclesLate) {   ....   if (gameModeSocket &lt; 0)   {     \/\/ ReSchedule     CoreTiming::ScheduleEvent(usToCycles(GAMEMODE_UPDATE_INTERVAL) - cyclesLate,                               gameModeNotifyEvent, userdata);     return;   }    auto sock = adhocSockets[gameModeSocket - 1];   .... } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V557 Array underrun is possible. The value of &#8216;gameModeSocket &#8212; 1&#8217; index could reach -1. sceNetAdhoc.cpp <a href=\"https:\/\/github.com\/hrydgard\/ppsspp\/blob\/0f50225f8e741c2f8a3a35cfd3b7d9dd0a16b34f\/Core\/HLE\/sceNetAdhoc.cpp#L191\">191<\/a><\/p>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u043c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <code>sock<\/code>. \u041c\u044b \u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u0435\u0451 \u043f\u044b\u0442\u0430\u044e\u0442\u0441\u044f \u043f\u0440\u043e\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u043c \u043c\u0430\u0441\u0441\u0438\u0432\u0430 <code>adHocSockets<\/code> \u0441 \u0438\u043d\u0434\u0435\u043a\u0441\u043e\u043c <code>gameModeSocket - 1<\/code>.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043e\u0431\u0440\u0430\u0442\u0438\u043c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u0432\u044b\u0448\u0435. \u041e\u043d\u0430 \u043e\u0442\u0441\u0435\u0438\u0432\u0430\u0435\u0442 \u0432\u0441\u0435 \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <code>gameModeSocket<\/code>.<\/p>\n<p>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0437\u0430\u0431\u044b\u043b\u0438 \u0443\u0447\u0435\u0441\u0442\u044c \u0441\u043b\u0443\u0447\u0430\u0439, \u043a\u043e\u0433\u0434\u0430 <code>gameModeSocket<\/code> \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0432\u0435\u043d \u043d\u0443\u043b\u044e. \u0422\u043e\u0433\u0434\u0430 \u0438\u043d\u0434\u0435\u043a\u0441 <code>gameModeSocket - 1<\/code> \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c, \u0438 \u044d\u0442\u043e \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u0442 \u043a UB.<\/p>\n<p>\u0418\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"cpp\">if (gameModeSocket &lt;= 0) <\/code><\/pre>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N4<\/strong><\/p>\n<pre><code class=\"cpp\">SoftGPU::SoftGPU(GraphicsContext *gfxCtx, Draw::DrawContext *draw)   : GPUCommon(gfxCtx, draw) {   ....   drawEngine_ = new SoftwareDrawEngine();   if (!drawEngine_)     return;   .... } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V668 There is no sense in testing the &#8216;drawEngine_&#8217; pointer against null, as the memory was allocated using the &#8216;new&#8217; operator. The exception will be generated in the case of memory allocation error. SoftGpu.cpp <a href=\"https:\/\/github.com\/hrydgard\/ppsspp\/blob\/0f50225f8e741c2f8a3a35cfd3b7d9dd0a16b34f\/GPU\/Software\/SoftGpu.cpp#L436\">436<\/a><\/p>\n<p>\u041a\u0430\u043a \u0443\u0436\u0435 \u043a\u0440\u0430\u0441\u043d\u043e\u0440\u0435\u0447\u0438\u0432\u043e \u043f\u043e\u0434\u043c\u0435\u0442\u0438\u043b\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f, \u043d\u0435\u0442 \u0441\u043c\u044b\u0441\u043b\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 <code>new<\/code>. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435\u0445\u0432\u0430\u0442\u043a\u0438 \u043f\u0430\u043c\u044f\u0442\u0438 \u0438\u043b\u0438 \u043a\u0430\u043a\u043e\u0439-\u043b\u0438\u0431\u043e \u0434\u0440\u0443\u0433\u043e\u0439 \u043e\u0448\u0438\u0431\u043a\u0438 \u043e\u043d \u0431\u0440\u043e\u0441\u0438\u0442 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435.<\/p>\n<p>\u0412\u0435\u0440\u043e\u044f\u0442\u043d\u043e, \u0442\u0430\u043a\u043e\u0439 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u0432\u043e\u0437\u043d\u0438\u043a \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433\u0430, \u0430 \u0440\u0430\u043d\u044c\u0448\u0435 \u0437\u0434\u0435\u0441\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f <code>malloc<\/code>.<\/p>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N5<\/strong><\/p>\n<pre><code class=\"cpp\">static std::vector&lt;MicWaitInfo&gt; waitingThreads; .... static void __MicBlockingResume(u64 userdata, int cyclesLate) {   ....   int count = 0;   for (auto waitingThread : waitingThreads)   {     if (waitingThread.threadID == threadID)     {       ....       if (Microphone::isHaveDevice())       {         if (Microphone::getReadMicDataLength() &gt;= waitingThread.needSize)         {           ....           waitingThreads.erase(waitingThreads.begin() + count);    \/\/ &lt;=         }         else         {           ....         }       }        else       {         ....         waitingThreads.erase(waitingThreads.begin() + count);      \/\/ &lt;=         readMicDataLength += waitingThread.needSize;       }     }      ++count;   } } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f PVS-Studio:<\/p>\n<ul>\n<li>\n<p>V789 Iterators for the &#8216;waitingThreads&#8217; container, used in the range-based for loop, become invalid upon the call of the &#8216;erase&#8217; function. sceUsbMic.cpp <a href=\"https:\/\/github.com\/hrydgard\/ppsspp\/blob\/0f50225f8e741c2f8a3a35cfd3b7d9dd0a16b34f\/Core\/HLE\/sceUsbMic.cpp#L73\">73<\/a><\/p>\n<\/li>\n<li>\n<p>V789 Iterators for the &#8216;waitingThreads&#8217; container, used in the range-based for loop, become invalid upon the call of the &#8216;erase&#8217; function. sceUsbMic.cpp 87<\/p>\n<\/li>\n<\/ul>\n<p>\u041e\u0434\u0438\u043d \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u043d\u0435\u043e\u0431\u044b\u0447\u043d\u044b\u0445 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u043f\u0440\u043e\u0441\u0442\u0440\u0435\u043b\u0438\u0442\u044c \u0441\u0435\u0431\u0435 \u043d\u043e\u0433\u0443, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f \u0432\u0438\u0434\u0435\u043b.<\/p>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u043c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u043a\u043e\u0434 <code>waitingThreads.erase(waitingThreads.begin() + count);<\/code>. \u041e\u043d \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432 \u0434\u0432\u0443\u0445 \u043c\u0435\u0441\u0442\u0430\u0445 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0442\u043e\u0433\u043e, \u043f\u043e \u043a\u0430\u043a\u043e\u0439 \u0432\u0435\u0442\u043a\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u0439 \u043c\u044b \u043f\u043e\u0439\u0434\u0451\u043c.<\/p>\n<p>\u0412 \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u043c \u043a\u043e\u0434\u0435 \u043c\u043e\u0436\u0435\u0442 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0443\u0442\u044c \u0440\u044f\u0434 \u043f\u0440\u043e\u0431\u043b\u0435\u043c. \u041f\u043e\u0441\u043b\u0435 \u0442\u0430\u043a\u043e\u0433\u043e \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f <a href=\"https:\/\/en.cppreference.com\/w\/cpp\/container\/vector\/erase#:~:text=Iterators%20(including%20the%20end()%20iterator)%20and%20references%20to%20the%20elements%20at%20or%20after%20the%20point%20of%20the%20erase%20are%20invalidated.\">\u0438\u043d\u0432\u0430\u043b\u0438\u0434\u0438\u0440\u0443\u044e\u0442\u0441\u044f<\/a> \u0432\u0441\u0435 \u0438\u0442\u0435\u0440\u0430\u0442\u043e\u0440\u044b \u0438 \u0441\u0441\u044b\u043b\u043a\u0438 \u0432 \u0442\u043e\u0447\u043a\u0435 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \u0438\u043b\u0438 \u043f\u043e\u0441\u043b\u0435 \u043d\u0435\u0451, \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u0438\u0442\u0435\u0440\u0430\u0442\u043e\u0440 <code>end()<\/code>. \u0422\u043e \u0435\u0441\u0442\u044c \u043f\u0440\u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u043f\u0440\u043e\u0445\u043e\u0434\u0435 \u0446\u0438\u043a\u043b\u0430 \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0443\u0436\u0435 \u043d\u0435\u0432\u0430\u043b\u0438\u0434\u043d\u044b\u0439 \u0438\u0442\u0435\u0440\u0430\u0442\u043e\u0440.<\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/ed3\/bf3\/506\/ed3bf3506a3931256fcdd39ff9e37928.png\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/\/post_images\/ed3\/bf3\/506\/ed3bf3506a3931256fcdd39ff9e37928.png\"\/><\/figure>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0442\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u043e\u0439 erase-remove \u0438\u0434\u0438\u043e\u043c\u043e\u0439, \u0430 \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 C++20, \u043f\u043e\u044f\u0432\u0438\u043b\u0438\u0441\u044c <a href=\"https:\/\/en.cppreference.com\/w\/cpp\/container\/vector\/erase2\">std::erase\/std::erase_if<\/a>. \u041d\u043e \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u0445\u043e\u0440\u043e\u0448\u0435\u043d\u044c\u043a\u043e \u043e\u0442\u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u0442\u044c \u043a\u043e\u0434.<\/p>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N6<\/strong><\/p>\n<pre><code class=\"cpp\">void Int_VecDo3(MIPSOpcode op) {   ....   u32 lastsat = (currentMIPS-&gt;vfpuCtrl[VFPU_CTRL_DPREFIX] &amp; 3) &lt;&lt; (n + n - 2);   .... } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438e PVS-Studio: V610 Undefined behavior. Check the shift operator &#8216;&lt;&lt;&#8216;. The right operand is negative (&#8216;(n + n &#8212; 2)&#8217; = [-2..6]). MIPSIntVFPU.cpp <a href=\"https:\/\/github.com\/hrydgard\/ppsspp\/blob\/0f50225f8e741c2f8a3a35cfd3b7d9dd0a16b34f\/Core\/MIPS\/MIPSIntVFPU.cpp#L2155\">2155<\/a><\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043d\u044f\u0442\u044c \u0432 \u0447\u0451\u043c \u0442\u0443\u0442 \u043e\u0448\u0438\u0431\u043a\u0430, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <code>n<\/code>.<\/p>\n<p>\u0412\u043e\u0442 \u043e\u043d\u043e:<\/p>\n<pre><code class=\"cpp\">u32 n = GetNumVectorElements(sz); <\/code><\/pre>\n<p>\u0422\u0430\u043a \u043f\u043e\u0447\u0435\u043c\u0443 \u0436\u0435 \u0440\u0443\u0433\u0430\u0435\u0442\u0441\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440?<\/p>\n<p>\u0412\u0441\u0451 \u0434\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043e\u0442\u0440\u0430\u0431\u043e\u0442\u0430\u043b \u043c\u0435\u0436\u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u043d\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0437. \u041f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>GetNumVectorElements<\/code>, \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0443\u0437\u043d\u0430\u043b, \u0447\u0442\u043e \u043e\u043d\u0430 \u043c\u043e\u0436\u0435\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0435 <code>[0 .. 4]<\/code>.<\/p>\n<p>\u0414\u0430\u043b\u044c\u0448\u0435, \u0443\u0432\u0438\u0434\u0435\u0432, \u0447\u0442\u043e <code>n<\/code> \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u043e \u043a\u043e\u0434\u0443, \u043e\u043d \u043c\u043e\u0436\u0435\u0442 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432\u044b\u0432\u043e\u0434, \u0447\u0442\u043e \u0432 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0438 <code>(n + n - 2)<\/code> \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0439 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 [-2..6].<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 <a href=\"https:\/\/github.com\/hrydgard\/ppsspp\/blob\/fdaf37b9ec468aeb433e425d999cfe691eca0d38\/Core\/MIPS\/MIPS.h#L202\"><code>vpfuCtrl<\/code><\/a>. \u042d\u0442\u043e \u043c\u0430\u0441\u0441\u0438\u0432 32-\u0431\u0438\u0442\u043d\u044b\u0445 \u0431\u0435\u0437\u0437\u043d\u0430\u043a\u043e\u0432\u044b\u0445 \u0447\u0438\u0441\u0435\u043b. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 \u0437\u0434\u0435\u0441\u044c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442 \u043e\u0431\u044b\u0447\u043d\u044b\u0439 \u043f\u043e\u0431\u0438\u0442\u043e\u0432\u044b\u0439 \u0441\u0434\u0432\u0438\u0433 \u0432\u043b\u0435\u0432\u043e \u043d\u0430 -2 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430. \u041a\u0430\u043a \u044d\u0442\u043e? \u0410 <a href=\"https:\/\/en.cppreference.com\/w\/cpp\/language\/operator_arithmetic#Bitwise_shift_operators\">\u043a\u0430\u043a \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f<\/a>.<\/p>\n<p>\u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0435 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f:<\/p>\n<ul>\n<li>\n<p>V610 Undefined behavior. Check the shift operator &#8216;&lt;&lt;&#8216;. The right operand is negative (&#8216;(n &#8212; 1)&#8217; = [-1..3]). MIPSIntVFPU.cpp 2261<\/p>\n<\/li>\n<li>\n<p>V610 Undefined behavior. Check the shift operator &#8216;&lt;&lt;&#8216;. The right operand is negative (&#8216;(n + n &#8212; 2)&#8217; = [-2..6]). MIPSIntVFPU.cpp 2262<\/p>\n<\/li>\n<\/ul>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N7<\/strong><\/p>\n<pre><code class=\"cpp\">inline float Float16ToFloat(float16 ix) {     float x;     memcpy(&amp;x, &amp;ix, sizeof(float));     return x; } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V512 A call of the &#8216;memcpy&#8217; function will lead to the &#8216;&amp; ix&#8217; buffer becoming out of range. math_util.h <a href=\"https:\/\/github.com\/hrydgard\/ppsspp\/blob\/0f50225f8e741c2f8a3a35cfd3b7d9dd0a16b34f\/Common\/Math\/math_util.h#L23\">23<\/a><\/p>\n<p>\u041c\u044b \u043f\u044b\u0442\u0430\u0435\u043c\u0441\u044f \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438\u0437 \u0442\u0438\u043f\u0430 <code>float16<\/code> \u0432 \u0442\u0438\u043f <code>float<\/code>. \u0422\u0438\u043f <code>float16<\/code> \u044d\u0442\u043e <code>unsigned short<\/code>:<\/p>\n<pre><code class=\"cpp\">typedef unsigned short float16; <\/code><\/pre>\n<p>\u0420\u0430\u0437\u043c\u0435\u0440\u044b <code>unsigned short<\/code> \u0438 <code>float<\/code> \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442\u0441\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439, \u043e\u0434\u043d\u0430\u043a\u043e \u043d\u0430 \u043c\u043d\u043e\u0433\u0438\u0445 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430\u0445 \u043e\u043d\u0438 \u0440\u0430\u0432\u043d\u044b 16 \u0438 32 \u0431\u0438\u0442\u0430\u043c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e.<\/p>\n<p>\u0414\u0430\u043b\u044c\u0448\u0435 \u043e\u0431\u0440\u0430\u0442\u0438\u043c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0442\u0440\u0435\u0442\u0438\u0439 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u0432 \u0432\u044b\u0437\u043e\u0432\u0435 <code>memcpy<\/code>. \u041e\u043d \u0433\u043e\u0432\u043e\u0440\u0438\u0442, \u043a\u0430\u043a\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0431\u0430\u0439\u0442\u043e\u0432 \u043d\u0430\u0434\u043e \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0437 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <code>ix<\/code>. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435, \u043a\u043e\u0433\u0434\u0430 \u0440\u0430\u0437\u043c\u0435\u0440 <code>float<\/code> \u0440\u0430\u0432\u0435\u043d 32 \u0431\u0438\u0442\u0430\u043c (4 \u0431\u0430\u0439\u0442\u0430), \u0430 \u0440\u0430\u0437\u043c\u0435\u0440 <code>unsigned short<\/code> 16 \u0431\u0438\u0442\u0430\u043c (2 \u0431\u0430\u0439\u0442\u0430), \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0451\u0442 \u0432\u044b\u0445\u043e\u0434 \u0437\u0430 \u0433\u0440\u0430\u043d\u0438\u0446\u044b \u0431\u0443\u0444\u0435\u0440\u0430 <code>ix<\/code>.<\/p>\n<h4>\u0418\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u044b\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438<\/h4>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N8<\/strong><\/p>\n<pre><code class=\"cpp\">void Jit::Comp_SVQ(MIPSOpcode op) {   CONDITIONAL_DISABLE(LSU_VFPU);    int imm = (signed short)(op&amp;0xFFFC);   int vt = (((op &gt;&gt; 16) &amp; 0x1f)) | ((op&amp;1) &lt;&lt; 5);   MIPSGPReg rs = _RS;    CheckMemoryBreakpoint(0, rs, imm);    switch (op &gt;&gt; 26)   {     case 53: \/\/lvl.q\/lvr.q     {       if (!g_Config.bFastMemory)       {         DISABLE;       }        DISABLE;   .... } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V523 [CWE-691] The &#8216;then&#8217; statement is equivalent to the subsequent code fragment. CompVFPU.cpp <a href=\"https:\/\/github.com\/hrydgard\/ppsspp\/blob\/0f50225f8e741c2f8a3a35cfd3b7d9dd0a16b34f\/Core\/MIPS\/x86\/CompVFPU.cpp#L313\">313<\/a><\/p>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u043c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0432 <em>then<\/em>-\u0432\u0435\u0442\u043a\u0435 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 <code>if<\/code> \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u0442\u0430\u043a\u043e\u0439 \u0436\u0435 \u043a\u043e\u0434, \u043a\u0430\u043a \u0438 \u043f\u043e\u0441\u043b\u0435 \u0441\u0430\u043c\u043e\u0439 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438. \u0410 \u0432\u043e\u0442 \u0447\u0442\u043e \u0438\u0437 \u0441\u0435\u0431\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u0430\u043c \u043c\u0430\u043a\u0440\u043e\u0441 <code>DISABLE<\/code>:<\/p>\n<pre><code class=\"cpp\">#define DISABLE { fpr.ReleaseSpillLocks(); Comp_Generic(op); return; } <\/code><\/pre>\n<p>\u041f\u043e\u043d\u044f\u0442\u043d\u043e, \u0447\u0442\u043e \u043d\u0438\u0447\u0435\u0433\u043e \u0441\u0435\u0440\u044c\u0451\u0437\u043d\u043e\u0433\u043e \u0437\u0434\u0435\u0441\u044c \u043d\u0435 \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0451\u0442, \u0442\u0430\u043a \u043a\u0430\u043a \u043c\u044b \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u0432\u044b\u0439\u0434\u0435\u043c \u0438\u0437 \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u0412\u043e\u043f\u0440\u043e\u0441 \u0432 \u0442\u043e\u043c, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043b\u0438 \u0437\u0434\u0435\u0441\u044c \u043b\u0438\u0448\u043d\u0438\u043c \u0443\u0441\u043b\u043e\u0432\u0438\u0435, \u0438\u043b\u0438 \u0432 \u0442\u0435\u043b\u0435 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u043b \u0431\u044b\u0442\u044c \u0434\u0440\u0443\u0433\u043e\u0439 \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u0434 \u0432\u044b\u0445\u043e\u0434\u043e\u043c \u0438\u0437 \u0444\u0443\u043d\u043a\u0446\u0438\u0438? \u0418\u043b\u0438 \u044d\u0442\u043e \u0431\u0430\u043d\u0430\u043b\u044c\u043d\u043e \u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u0430\u044f TODO?<\/p>\n<p>\u041e\u0434\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u043e \u043f\u043e \u0442\u0430\u043a\u043e\u043c\u0443 \u043a\u043e\u0434\u0443 \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435\u043b\u044c\u0437\u044f, \u0442\u0430\u043a \u043a\u0430\u043a \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432 \u0442\u043e\u0436\u0435 \u043d\u0435\u0442. \u0418\u043c\u0435\u043d\u043d\u043e \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0438 \u043f\u043b\u043e\u0445.<\/p>\n<p>\u041f\u043e\u0445\u043e\u0436\u0438\u0435 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f:<\/p>\n<ul>\n<li>\n<p>V523 The &#8216;then&#8217; statement is equivalent to the subsequent code fragment. IRCompVFPU.cpp 2375<\/p>\n<\/li>\n<li>\n<p>V523 The &#8216;then&#8217; statement is equivalent to the subsequent code fragment. IRCompVFPU.cpp 1167<\/p>\n<\/li>\n<\/ul>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N9<\/strong><\/p>\n<pre><code class=\"cpp\">void BlockAllocator::Block::DoState(PointerWrap &amp;p) {   ....   size_t tagLen = strlen(tag);   if (tagLen != sizeof(tag))     memset(tag + tagLen, 0, sizeof(tag) - tagLen);   DoArray(p, tag, sizeof(tag)); } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V547 Expression &#8216;tagLen != sizeof (tag)&#8217; is always true. BlockAllocator.cpp <a href=\"https:\/\/github.com\/hrydgard\/ppsspp\/blob\/0f50225f8e741c2f8a3a35cfd3b7d9dd0a16b34f\/Core\/Util\/BlockAllocator.cpp#L508\">508<\/a><\/p>\n<p>\u0418\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0430\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430. \u0412\u0437\u0433\u043b\u044f\u043d\u0435\u043c \u043d\u0430 \u0434\u0435\u043a\u043b\u0430\u0440\u0430\u0446\u0438\u044e \u043c\u0430\u0441\u0441\u0438\u0432\u0430 <a href=\"https:\/\/github.com\/hrydgard\/ppsspp\/blob\/fdaf37b9ec468aeb433e425d999cfe691eca0d38\/Core\/Util\/BlockAllocator.h#L69\"><code>tag<\/code><\/a>:<\/p>\n<pre><code class=\"cpp\">char tag[32]; <\/code><\/pre>\n<p>\u0412\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 <code>sizeof(tag)<\/code> \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0432\u043d\u043e 32. \u0412\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 <code>tagLen != sizeof(tag)<\/code> \u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f <code>false<\/code>, \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u0433\u0434\u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 <code>strlen(tag)<\/code> \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0432\u0435\u043d 32. \u041e\u0434\u043d\u0430\u043a\u043e \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u043e\u0436\u0435\u0442 \u0432\u0435\u0440\u043d\u0443\u0442\u044c <code>strlen<\/code> \u0434\u043b\u044f <code>tag<\/code>, \u044d\u0442\u043e 31, \u0442\u0430\u043a \u043a\u0430\u043a \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0441\u0438\u043c\u0432\u043e\u043b \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/terms\/0088\/\">\u043d\u0443\u043b\u044c-\u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u043e\u043c<\/a>. \u0422\u043e \u0435\u0441\u0442\u044c \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442, \u043a\u043e\u0433\u0434\u0430 \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u043d\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0441\u044f, \u044d\u0442\u043e \u0435\u0441\u043b\u0438 <code>tag<\/code> \u0431\u0443\u0434\u0435\u0442 \u043d\u0435 \u043d\u0443\u043b\u044c-\u0442\u0435\u0440\u043c\u0438\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u043e\u0439. \u041d\u043e \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0432\u0441\u043f\u043b\u044b\u043b \u0431\u044b \u043e\u0434\u0438\u043d \u043d\u044e\u0430\u043d\u0441 \u2014 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 <code>strlen<\/code> \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0431\u044b <a href=\"https:\/\/en.cppreference.com\/w\/cpp\/string\/byte\/strlen#:~:text=The%20behavior%20is,str\">\u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u043c<\/a>. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u0430\u043a <code>true<\/code> \u0438 <code>memset<\/code> \u0432\u0441\u0435\u0433\u0434\u0430 \u0437\u0430\u043d\u0443\u043b\u044f\u0435\u0442 <code>sizeof(tag) - tagLen<\/code> \u0431\u0430\u0439\u0442.<\/p>\n<p>\u0415\u0449\u0451 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f V547:<\/p>\n<ul>\n<li>\n<p>V547 Expression &#8216;leftvol &gt;= 0&#8217; is always true. sceAudio.cpp 121<\/p>\n<\/li>\n<li>\n<p>V547 Expression &#8216;rightvol &gt;= 0&#8217; is always true. sceAudio.cpp 124<\/p>\n<\/li>\n<\/ul>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N10<\/strong><\/p>\n<pre><code class=\"cpp\">void netAdhocValidateLoopMemory() {   \/\/ Allocate Memory if it wasn't valid\/allocated   \/\/ after loaded from old SaveState   if (   !dummyThreadHackAddr       || (   dummyThreadHackAddr           &amp;&amp; strcmp(\"dummythreadhack\",                     kernelMemory.GetBlockTag(dummyThreadHackAddr)) != 0))   {   .... } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V728 An excessive check can be simplified. The &#8216;||&#8217; operator is surrounded by opposite expressions &#8216;!dummyThreadHackAddr&#8217; and &#8216;dummyThreadHackAddr&#8217;. sceNetAdhoc.cpp <a href=\"https:\/\/github.com\/hrydgard\/ppsspp\/blob\/0f50225f8e741c2f8a3a35cfd3b7d9dd0a16b34f\/Core\/HLE\/sceNetAdhoc.cpp#L1121\">1121<\/a><\/p>\n<p>\u0414\u0443\u043c\u0430\u044e, \u0432\u043f\u043e\u043b\u043d\u0435 \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e\u0435 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u0438 \u043c\u0435\u0441\u0442\u043e, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u043e\u0436\u043d\u043e \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c.<\/p>\n<p>\u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043c, \u0447\u0442\u043e \u043c\u044b \u2014 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0438 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0435\u043c \u044d\u0442\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u0435. \u0422\u0430\u043a \u043a\u0430\u043a \u043c\u044b \u043e\u0431\u044f\u0437\u0430\u043d\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0435\u0433\u043e \u0441\u043b\u0435\u0432\u0430 \u043d\u0430\u043f\u0440\u0430\u0432\u043e, \u043c\u044b \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u043b\u0435\u0432\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u043e\u0442 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 <code>||<\/code>. \u0423\u0441\u043b\u043e\u0432\u0438\u0435 <code>!dummyThreadHackAddr<\/code> \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c <code>true<\/code> \u0438\u043b\u0438 <code>false<\/code>. \u0415\u0441\u043b\u0438 <code>true<\/code>, \u0442\u043e \u043c\u044b \u0441\u0440\u0430\u0437\u0443 \u0437\u0430\u0445\u043e\u0434\u0438\u043c \u0432\u043d\u0443\u0442\u0440\u044c. \u0415\u0441\u043b\u0438 <code>false<\/code>, \u0442\u043e \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u043f\u043e\u0434\u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 <code>dummyThreadHackAddr<\/code> \u2014 \u044d\u0442\u043e \u0432\u0441\u0435\u0433\u0434\u0430 <code>true<\/code>.<\/p>\n<p>\u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u043c\u043e\u0436\u043d\u043e \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c:<\/p>\n<pre><code class=\"cpp\">if (   !dummyThreadHackAddr      || strcmp(\"dummythreadhack\",               kernelMemory.GetBlockTag(dummyThreadHackAddr)) != 0)) <\/code><\/pre>\n<p>\u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0435 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f:<\/p>\n<ul>\n<li>\n<p>V728 An excessive check can be simplified. The &#8216;||&#8217; operator is surrounded by opposite expressions &#8216;!matchingThreadHackAddr&#8217; and &#8216;matchingThreadHackAddr&#8217;. sceNetAdhoc.cpp 1126<\/p>\n<\/li>\n<li>\n<p>V728 An excessive check can be simplified. The &#8216;||&#8217; operator is surrounded by opposite expressions &#8216;!regs[i].away&#8217; and &#8216;regs[i].away&#8217;. RegCache.cpp 352<\/p>\n<\/li>\n<\/ul>\n<h4>\u041f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c<\/h4>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N11<\/strong><\/p>\n<pre><code class=\"cpp\">void QueueCallback(void (*func)(VulkanContext *vulkan, void *userdata),                    void *userdata) {    callbacks_.push_back(Callback(func, userdata)); } void VulkanRenderManager::EndCurRenderStep() {   for (VKRGraphicsPipeline *pipeline : pipelinesToCheck_)   {     if (!pipeline)     {       \/\/ Not good, but let's try not to crash.       continue;     }      if (!pipeline-&gt;pipeline[(size_t)rpType])     {       pipeline-&gt;pipeline[(size_t)rpType] = Promise&lt;VkPipeline&gt;::CreateEmpty();       _assert_(renderPass);       compileQueue_.push_back(CompileQueueEntry(pipeline,             renderPass-&gt;Get(vulkan_, rpType, sampleCount),rpType, sampleCount));       needsCompile = true;     }   } } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V823 Decreased performance. Object may be created in-place in the &#8216;compileQueue_&#8217; container. Consider replacing methods: &#8216;push_back&#8217; -&gt; &#8217;emplace_back&#8217;. VulkanRenderManager.cpp <a href=\"https:\/\/github.com\/hrydgard\/ppsspp\/blob\/0f50225f8e741c2f8a3a35cfd3b7d9dd0a16b34f\/Common\/GPU\/Vulkan\/VulkanRenderManager.cpp#L883\">883<\/a><\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0447\u0442\u043e \u0438\u0437 \u0441\u0435\u0431\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 <code>compileQueue_<\/code>:<\/p>\n<pre><code class=\"cpp\">std::vector&lt;CompileQueueEntry&gt; compileQueue_; <\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 <code>CompileQueueEntry<\/code>:<\/p>\n<pre><code class=\"cpp\">struct CompileQueueEntry {   CompileQueueEntry(VKRGraphicsPipeline *p,                     VkRenderPass _compatibleRenderPass,                     RenderPassType _renderPassType,                     VkSampleCountFlagBits _sampleCount)   : type(Type::GRAPHICS), graphics(p),          compatibleRenderPass(_compatibleRenderPass),          renderPassType(_renderPassType), sampleCount(_sampleCount){}    enum class Type   {     GRAPHICS,   };    Type type;   VkRenderPass compatibleRenderPass;   RenderPassType renderPassType;   VKRGraphicsPipeline* graphics = nullptr;   VkSampleCountFlagBits sampleCount;  }; <\/code><\/pre>\n<p>\u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <code>compileQueue_<\/code> \u2014 \u044d\u0442\u043e \u043e\u0431\u044b\u0447\u043d\u044b\u0439 <code>std::vector<\/code>, \u0430 <code>CompileQueueEntry<\/code> \u2014 \u044d\u0442\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0438\u043c\u0435\u0435\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440. \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043a\u043e\u0434 \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u0435\u0435, \u0435\u0441\u043b\u0438 \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c <code>push_back<\/code> \u043d\u0430 <code>emplace_back<\/code>, \u043e \u0447\u0451\u043c \u044f \u043f\u0438\u0441\u0430\u043b \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/cpp\/1167\/\">\u0441\u0442\u0430\u0442\u044c\u0435<\/a>.<\/p>\n<p>\u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u043e\u0436\u043d\u043e \u0443\u0431\u0440\u0430\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u044f\u0442\u0438 \u043f\u043e\u043b\u0435\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b <code>CompileQueueEntry<\/code> \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0432 \u0432\u0435\u043a\u0442\u043e\u0440. \u0414\u0430, \u0442\u0430\u043a\u043e\u0435 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0435 \u0442\u044f\u0436\u0435\u043b\u043e\u0432\u0435\u0441\u043d\u043e\u0435. \u041d\u043e \u0442\u0430\u043a\u0438\u0445 \u043c\u0435\u0441\u0442 \u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043c\u043d\u043e\u0433\u043e. \u0414\u0430 \u0438 \u043d\u0435\u0442 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0438, \u0447\u0442\u043e \u043f\u043e\u0442\u043e\u043c \u044d\u0442\u0430 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043d\u0435 \u0441\u0442\u0430\u043d\u0435\u0442 \u0442\u044f\u0436\u0435\u043b\u043e\u0432\u0435\u0441\u043d\u043e\u0439, \u0430 \u0432\u0441\u0442\u0430\u0432\u043a\u0443 \u043d\u0435 \u0437\u0430\u0431\u0443\u0434\u0443\u0442 \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c \u043d\u0430 <code>emplace_back<\/code>.<\/p>\n<p>\u041a\u0441\u0442\u0430\u0442\u0438, \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 C++20, <code>emplace_back<\/code> \u0431\u0443\u0434\u0435\u0442 <a href=\"https:\/\/www.open-std.org\/jtc1\/sc22\/wg21\/docs\/papers\/2019\/p0960r3.html\">\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c<\/a> \u0442\u0430\u043a\u0436\u0435 \u0438 \u0441 \u0430\u0433\u0440\u0435\u0433\u0430\u0442\u043d\u044b\u043c\u0438 \u0442\u0438\u043f\u0430\u043c\u0438.<\/p>\n<p>\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f:<\/p>\n<ul>\n<li>\n<p>V823 Decreased performance. Object may be created in-place in the &#8216;callbacks_&#8217; container. Consider replacing methods: &#8216;push_back&#8217; -&gt; &#8217;emplace_back&#8217;. VulkanContext.h 128<\/p>\n<\/li>\n<li>\n<p>V823 Decreased performance. Object may be created in-place in the &#8216;threads_&#8217; container. Consider replacing methods: &#8216;push_back&#8217; -&gt; &#8217;emplace_back&#8217;. HTTPServer.cpp 48<\/p>\n<\/li>\n<\/ul>\n<h4>\u0420\u0430\u0437\u043d\u043e\u0435<\/h4>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N12<\/strong><\/p>\n<pre><code class=\"cpp\">bool Key(const KeyInput &amp;key) override {   std::vector&lt;int&gt; pspKeys;               \/\/ &lt;=   bool showInfo = false;   if (HasFocus() &amp;&amp; UI::IsInfoKey(key))   {     \/\/ If the button mapped to triangle, then show the info.     if (key.flags &amp; KEY_UP)     {       showInfo = true;     }   }   else if (hovering_ &amp;&amp; key.deviceId == DEVICE_ID_MOUSE                       &amp;&amp; key.keyCode == NKCODE_EXT_MOUSEBUTTON_2)   {     \/\/ If it's the right mouse button, and it's not otherwise mapped,     \/\/ show the info also.     if (key.flags &amp; KEY_DOWN)     {       showInfoPressed_ = true;     }     if ((key.flags &amp; KEY_UP) &amp;&amp; showInfoPressed_)     {       showInfo = true;       showInfoPressed_ = false;     }   }    if (showInfo)    {      TriggerOnHoldClick();      return true;   }    return Clickable::Key(key); } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V808 &#8216;pspKeys&#8217; object of &#8216;vector&#8217; type was created but was not utilized. MainScreen.cpp <a href=\"https:\/\/github.com\/hrydgard\/ppsspp\/blob\/0f50225f8e741c2f8a3a35cfd3b7d9dd0a16b34f\/UI\/MainScreen.cpp#L159\">159<\/a><\/p>\n<p>\u041f\u043e\u043d\u044f\u0442\u043d\u043e, \u0447\u0442\u043e \u043f\u0443\u0441\u0442\u043e\u0439 \u0432\u0435\u043a\u0442\u043e\u0440 \u043d\u0435 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u043c\u043d\u043e\u0433\u043e \u043c\u0435\u0441\u0442\u0430 \u0432 \u043f\u0430\u043c\u044f\u0442\u0438. \u041e\u0448\u0438\u0431\u043a\u0438 \u0442\u0430\u043a\u043e\u0433\u043e \u0442\u0438\u043f\u0430 \u043e\u043f\u0430\u0441\u043d\u044b \u0442\u0435\u043c, \u0447\u0442\u043e \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u043b\u043e\u0441\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u0434\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439, \u0430 \u0432\u043c\u0435\u0441\u0442\u043e \u043d\u0435\u0451 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438\u0441\u044c \u0434\u0440\u0443\u0433\u043e\u0439. \u0422\u0430\u043a\u043e\u0435 \u043c\u043e\u0436\u0435\u0442 \u0441\u043b\u0443\u0447\u0438\u0442\u044c\u0441\u044f, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0440\u0438 \u043e\u043f\u0435\u0447\u0430\u0442\u043a\u0435.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0435, \u043a\u0430\u043a \u0432\u0438\u0434\u043d\u043e, \u0432\u0441\u0451 \u0432 \u043f\u043e\u0440\u044f\u0434\u043a\u0435. \u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u0432\u0435\u043a\u0442\u043e\u0440 \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0441\u043b\u0435 \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u043a\u043e\u0434\u0430, \u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0434\u0441\u0432\u0435\u0447\u0438\u0432\u0430\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u043c\u0435\u0441\u0442\u0430.<\/p>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N13<\/strong><\/p>\n<pre><code class=\"cpp\">VkResult VulkanContext::InitDebugUtilsCallback() {   \/\/ We're intentionally skipping   \/\/ VK_DEBUG_UTILS_MESSAGE_SEVERITY_VERBOSE_BIT_EXT   \/\/ and VK_DEBUG_UTILS_MESSAGE_SEVERITY_INFO_BIT_EXT,   \/\/ just too spammy.   int bits = VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT            | VK_DEBUG_UTILS_MESSAGE_SEVERITY_WARNING_BIT_EXT            | VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT;   .... } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V501 There are identical sub-expressions &#8216;VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT&#8217; to the left and to the right of the &#8216;|&#8217; operator. VulkanContext.cpp <a href=\"https:\/\/github.com\/hrydgard\/ppsspp\/blob\/0f50225f8e741c2f8a3a35cfd3b7d9dd0a16b34f\/Common\/GPU\/Vulkan\/VulkanContext.cpp#L867\">867<\/a><\/p>\n<p>\u041e\u0448\u0438\u0431\u043a\u0438 \u0442\u0430\u043a\u043e\u0433\u043e \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u0430 \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u0445\u043e\u0436\u0438 \u043d\u0430 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u043b\u043e\u0441\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0434\u0440\u0443\u0433\u043e\u0439 \u0444\u043b\u0430\u0433, \u043d\u043e \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <em>copy-paste<\/em>, \u0435\u0433\u043e \u043c\u043e\u0433\u043b\u0438 \u0437\u0430\u0431\u044b\u0442\u044c \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c. \u0422\u0430\u043a\u0438\u0435 \u043e\u0448\u0438\u0431\u043a\u0438, \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u0442\u044f\u0436\u0435\u043b\u043e \u0438\u0449\u0443\u0442\u0441\u044f \u0433\u043b\u0430\u0437\u0430\u043c\u0438, \u043d\u043e \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437 \u0441 \u043d\u0438\u043c\u0438 \u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u0440\u0430\u0437-\u0434\u0432\u0430.<\/p>\n<h3>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>\u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u044c\u0442\u0435, \u0447\u0442\u043e \u0432\u044b \u0441\u0430\u0434\u0438\u0442\u0435\u0441\u044c \u0432 \u043a\u043e\u0441\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043a\u043e\u0440\u0430\u0431\u043b\u044c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u0451\u0442 \u0432\u0430\u0441 \u0432 \u043c\u0438\u0440 \u043d\u043e\u0441\u0442\u0430\u043b\u044c\u0433\u0438\u0438, \u0433\u0434\u0435 \u043a\u0430\u0436\u0434\u043e\u0435 \u043d\u0430\u0436\u0430\u0442\u0438\u0435 \u043a\u043d\u043e\u043f\u043a\u0438 \u043f\u0440\u043e\u0431\u0443\u0436\u0434\u0430\u0435\u0442 \u0432 \u0432\u0430\u0441 \u0432\u043e\u0441\u043f\u043e\u043c\u0438\u043d\u0430\u043d\u0438\u044f \u043e \u0437\u0430\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u044e\u0449\u0438\u0445 \u043f\u0440\u0438\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f\u0445 \u043d\u0430 PSP. \u041d\u043e \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u044d\u0442\u043e\u0442 \u043a\u043e\u0441\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043a\u043e\u0440\u0430\u0431\u043b\u044c \u043c\u043e\u0433 \u0432\u0437\u043b\u0435\u0442\u0435\u0442\u044c, \u0432\u0430\u0436\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u0443 \u043d\u0435\u0433\u043e \u0431\u044b\u043b\u0430 \u043d\u0430\u0434\u0451\u0436\u043d\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f. \u041f\u043e\u0434 \u043d\u0430\u0434\u0451\u0436\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u044f \u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u044e \u0445\u043e\u0440\u043e\u0448\u0438\u0439 \u043a\u043e\u0434. \u0410 \u043f\u043e\u0434 \u0445\u043e\u0440\u043e\u0448\u0438\u043c \u043a\u043e\u0434\u043e\u043c \u044f \u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u044e \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u043e, \u0447\u0442\u043e \u043e\u043d \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d, \u043d\u043e \u0438 \u0442\u043e, \u0447\u0442\u043e \u043e\u043d \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d \u0438 \u043e\u0442\u043b\u0430\u0436\u0435\u043d.<\/p>\n<p>\u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u0430\u0436\u043d\u043e \u043d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0442\u044c \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u0434 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c\u0438 \u043c\u0435\u0442\u043e\u0434\u0438\u043a\u0430\u043c\u0438, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0438 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430\u043c\u0438. \u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043f\u0440\u043e\u0431\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 PVS-Studio \u043c\u043e\u0436\u043d\u043e <a href=\"https:\/\/pvs-studio.ru\/ru\/pvs-studio\/try-free\/?utm_source=website&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=1217\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435\u0439 \u0441 \u0430\u043d\u0433\u043b\u043e\u044f\u0437\u044b\u0447\u043d\u043e\u0439 \u0430\u0443\u0434\u0438\u0442\u043e\u0440\u0438\u0435\u0439, \u0442\u043e \u043f\u0440\u043e\u0448\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u043f\u0435\u0440\u0435\u0432\u043e\u0434: Alexey Smolskas. <a href=\"https:\/\/pvs-studio.com\/en\/blog\/posts\/cpp\/1217\/\">PPSSPP or psp? Uncovering bugs from the past<\/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\/878286\/\"> https:\/\/habr.com\/ru\/articles\/878286\/<\/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-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412 \u043c\u0438\u0440\u0435 \u0432\u0438\u0434\u0435\u043e\u0438\u0433\u0440 \u044d\u043c\u0443\u043b\u044f\u0442\u043e\u0440\u044b \u0441\u0442\u0430\u043b\u0438 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u0439 \u043d\u0430\u0445\u043e\u0434\u043a\u043e\u0439 \u0434\u043b\u044f \u043f\u043e\u043a\u043b\u043e\u043d\u043d\u0438\u043a\u043e\u0432 \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432. PPSSPP \u2014 \u043e\u0434\u0438\u043d \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u044d\u043c\u0443\u043b\u044f\u0442\u043e\u0440\u043e\u0432 \u0434\u043b\u044f PlayStation Portable (PSP), \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043d\u0430\u043c \u0432\u043d\u043e\u0432\u044c \u043e\u043a\u0443\u043d\u0443\u0442\u044c\u0441\u044f \u0432 \u0430\u0442\u043c\u043e\u0441\u0444\u0435\u0440\u0443 \u043b\u044e\u0431\u0438\u043c\u044b\u0445 \u0438\u0433\u0440, \u043d\u043e \u0443\u0436\u0435 \u043d\u0430 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u0445. \u041e\u0434\u043d\u0430\u043a\u043e \u0447\u0442\u043e\u0431\u044b \u0438\u0433\u0440\u0430\u0442\u044c \u0431\u0435\u0437 \u0441\u0431\u043e\u0435\u0432 \u0438 \u043b\u0430\u0433\u043e\u0432, \u043d\u0443\u0436\u043d\u043e \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u043a\u043e\u0434 \u044d\u043c\u0443\u043b\u044f\u0442\u043e\u0440\u0430 \u0445\u043e\u0440\u043e\u0448\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d.<\/p>\n<figure class=\"\"><\/figure>\n<h3>\u041f\u0440\u0435\u0434\u0438\u0441\u043b\u043e\u0432\u0438\u0435<\/h3>\n<p>\u042d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0438\u043a\u0432\u0435\u043b\u043e\u043c \u0432\u043e\u0442 \u044d\u0442\u043e\u0439 <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/cpp\/1167\/\">\u0441\u0442\u0430\u0442\u044c\u0438<\/a>. \u0425\u043e\u0447\u0435\u0442\u0441\u044f \u043f\u043e\u0445\u0432\u0430\u043b\u0438\u0442\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 PPSSPP, \u0442\u0430\u043a \u043a\u0430\u043a \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0412\u0421\u0415 \u043e\u0448\u0438\u0431\u043a\u0438 \u0438\u0437 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0447\u0430\u0441\u0442\u0438, \u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043b, \u0431\u044b\u043b\u0438 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u044b \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0435 \u043c\u0435\u0441\u044f\u0446\u0430 \u0438 \u0432 \u0440\u0435\u043b\u0438\u0437 <a href=\"https:\/\/github.com\/hrydgard\/ppsspp\/tree\/v1.18.1\">1.18.1<\/a> \u043d\u0435 \u0432\u043e\u0448\u043b\u0438. \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u0432\u0441\u0435 \u043e\u0448\u0438\u0431\u043a\u0438, \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0435 \u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0438, \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u0442\u044c \u043c\u043d\u0435 \u043d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0438\u0437-\u0437\u0430 \u043d\u0435\u0445\u0432\u0430\u0442\u043a\u0438 \u0441\u0438\u043b \u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u0438. \u041a\u0430\u044e\u0441\u044c. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u0448\u0438\u0431\u043a\u0438, \u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u0438\u0448\u0443 \u0441\u0435\u0433\u043e\u0434\u043d\u044f, \u0432\u0441\u0451 \u0442\u0430\u043a \u0436\u0435 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0432 \u043a\u043e\u0434\u043e\u0432\u043e\u0439 \u0431\u0430\u0437\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \ud83d\ude42<\/p>\n<p>\u041e\u0448\u0438\u0431\u043e\u043a \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435, \u043a\u0430\u043a \u0438 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438, \u043c\u043e\u0433\u043b\u043e \u0431\u044b \u043d\u0435 \u0431\u044b\u0442\u044c, \u0435\u0441\u043b\u0438 \u0431\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438\u0441\u044c PVS-Studio. \u041a \u0441\u043b\u043e\u0432\u0443, \u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u044d\u0442\u043e \u0445\u043e\u0440\u043e\u0448\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u043e\u043c\u043d\u0438\u0442\u044c \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0432 PVS-Studio \u0435\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u0443\u044e \u043b\u0438\u0446\u0435\u043d\u0437\u0438\u044e \u0434\u043b\u044f open source \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e\u0431 \u044d\u0442\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u043d\u0430 <a href=\"https:\/\/pvs-studio.ru\/ru\/order\/open-source-license\/\">\u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435<\/a>.<\/p>\n<h3>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438<\/h3>\n<p>\u041a\u0430\u043a \u044f \u0443\u0436\u0435 \u0441\u043a\u0430\u0437\u0430\u043b \u0432\u044b\u0448\u0435, \u044d\u0442\u043e \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u0435 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u0448\u0438\u0431\u043a\u0438 \u043d\u0430\u0439\u0434\u0435\u043d\u044b \u043f\u0440\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0435 \u043a\u043e\u0434\u0430 PPSSPP \u0432\u0435\u0440\u0441\u0438\u0438 <a href=\"https:\/\/github.com\/hrydgard\/ppsspp\/tree\/v1.17.1\">1.17.1<\/a> \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 <a href=\"https:\/\/pvs-studio.ru\/ru\/\">PVS-Studio<\/a> \u043d\u0430 <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/manual\/6615\/\">Linux<\/a>. \u0412\u0435\u0440\u0441\u0438\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 \u2014 <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/manual\/0010\/#ID713ED1F05C\">7.32<\/a>. \u041d\u043e \u044d\u0442\u0438 \u043e\u0448\u0438\u0431\u043a\u0438 \u043f\u043e\u043f\u0430\u043b\u0438 \u0432 \u0440\u0435\u043b\u0438\u0437 1.18.1, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u0441\u0435 \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u0432 \u043a\u043e\u0434\u0435 \u043d\u0438\u0436\u0435 \u0432\u0435\u0434\u0443\u0442 \u043d\u0430 \u0432\u0435\u0440\u0441\u0438\u044e 1.18.1. \u0422\u0430\u043a\u0436\u0435 \u043e\u0442\u043c\u0435\u0447\u0443, \u0447\u0442\u043e \u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 PVS-Studio \u2014 7.34. \u041e\u0431 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u0445 \u0432 \u044d\u0442\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/manual\/0010\/#ID16CD252F62\">\u0442\u0443\u0442<\/a>.<\/p>\n<h4>Undefined behavior<\/h4>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N1<\/strong><\/p>\n<p>\u0410 \u043d\u0430\u0447\u043d\u0451\u043c \u043c\u044b \u0441 \u0442\u0430\u043a\u043e\u0433\u043e \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430:<\/p>\n<pre><code class=\"cpp\">static int sceNetAdhocctlGetAddrByName(const char *nickName,                                        u32 sizeAddr, u32 bufAddr) {   ....   \/\/ Copied to null-terminated var to prevent unexpected behaviour on Logs   memcpy(nckName, nickName, ADHOCCTL_NICKNAME_LEN);     ....   if (netAdhocctlInited)   {     \/\/ Valid Arguments     if (nickName != NULL &amp;&amp; buflen != NULL)     {       ....     }     ....   } } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V595 The &#8216;nickName&#8217; pointer was utilized before it was verified against nullptr. Check lines: 6143, 6152. sceNetAdhoc.cpp <a href=\"https:\/\/github.com\/hrydgard\/ppsspp\/blob\/0f50225f8e741c2f8a3a35cfd3b7d9dd0a16b34f\/Core\/HLE\/sceNetAdhoc.cpp#L6143\">6143<\/a><\/p>\n<p>\u041a\u0430\u043a \u043c\u044b \u0432\u0438\u0434\u0438\u043c, \u0432 <code>memcpy<\/code> \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442\u0441\u044f \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c <code>nickname<\/code> \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u0431\u0443\u0444\u0435\u0440\u0430. \u0427\u0443\u0442\u044c \u043d\u0438\u0436\u0435 \u043f\u043e \u043a\u043e\u0434\u0443 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f, \u043d\u0435 \u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u043b\u0438 \u044d\u0442\u043e\u0442 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c. \u0417\u043d\u0430\u0447\u0438\u0442, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442, \u0447\u0442\u043e \u0444\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0443\u043b\u0435\u0432\u044b\u043c. \u0417\u0430 \u0442\u043e\u0447\u043a\u0430\u043c\u0438, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u044f \u0441\u043a\u0440\u044b\u043b \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u044b\u0439 \u043a\u043e\u0434, \u043e\u043d \u0442\u043e\u0436\u0435 \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f (\u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u0442\u043a\u043d\u0443\u0432 \u043d\u0430 \u043d\u043e\u043c\u0435\u0440 \u0441\u0442\u0440\u043e\u043a\u0438 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f).<\/p>\n<p>\u0410 \u0447\u0442\u043e \u043f\u043e \u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u0432\u043e\u0434\u0443 \u0434\u0443\u043c\u0430\u0435\u0442 <code>memcpy<\/code>? \u0426\u0438\u0442\u0438\u0440\u0443\u044e <a href=\"https:\/\/en.cppreference.com\/w\/cpp\/string\/byte\/memcpy\">cpperefence<\/a>:<\/p>\n<blockquote>\n<p>If either dest or src is an invalid or null pointer, the behavior is undefined, even if count is zero.<\/p>\n<\/blockquote>\n<p>\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0435:<\/p>\n<ul>\n<li>\n<p>V595 The &#8216;buf2&#8217; pointer was utilized before it was verified against nullptr. Check lines: 364, 365.  __sceAudio.cpp 364<\/p>\n<\/li>\n<\/ul>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N2<\/strong><\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442:<\/p>\n<pre><code class=\"cpp\">int internal_profiler_find_cat(const char *category_name, bool create_missing) {   int i;   for (i = 0; i &lt; MAX_CATEGORIES; i++)   {     const char *catname = categories[i].name;     if (!catname)       break; #ifdef UNIFIED_CONST_STR     if (catname == category_name)     { #else     if (!strcmp(catname, category_name))                          \/\/ &lt;=     { #endif       return i;     }   }    if (i &lt; MAX_CATEGORIES &amp;&amp; category_name &amp;&amp; create_missing)      \/\/ &lt;=   {     ....   }      } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V595 The &#8216;category_name&#8217; pointer was utilized before it was verified against nullptr. Check lines: 103, 109. Profiler.cpp <a href=\"https:\/\/github.com\/hrydgard\/ppsspp\/blob\/0f50225f8e741c2f8a3a35cfd3b7d9dd0a16b34f\/Common\/Profiler\/Profiler.cpp#L103\">103<\/a><\/p>\n<p>\u0423 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f <code>category_name<\/code>, \u043d\u043e \u0441\u0445\u043e\u0434\u0443 \u043c\u043e\u0436\u043d\u043e \u043d\u0435 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0433\u0434\u0435 \u043e\u043d \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f.<\/p>\n<p>\u0412 \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u043d\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0430 \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u0430 <code>UNIFIED_CONST_STR<\/code>, \u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c <code>category_name<\/code> \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u043b\u0435\u0442\u0435\u0442\u044c \u0432 <code>strcmp<\/code>. \u0410 \u044d\u0442\u043e <a href=\"https:\/\/en.cppreference.com\/w\/cpp\/string\/byte\/strcmp#:~:text=The%20behavior%20is,null%2Dterminated%20strings.\">\u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442<\/a> \u043a UB.<\/p>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N3<\/strong><\/p>\n<pre><code class=\"cpp\">static void __GameModeNotify(u64 userdata, int cyclesLate) {   ....   if (gameModeSocket &lt; 0)   {     \/\/ ReSchedule     CoreTiming::ScheduleEvent(usToCycles(GAMEMODE_UPDATE_INTERVAL) - cyclesLate,                               gameModeNotifyEvent, userdata);     return;   }    auto sock = adhocSockets[gameModeSocket - 1];   .... } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V557 Array underrun is possible. The value of &#8216;gameModeSocket &#8212; 1&#8217; index could reach -1. sceNetAdhoc.cpp <a href=\"https:\/\/github.com\/hrydgard\/ppsspp\/blob\/0f50225f8e741c2f8a3a35cfd3b7d9dd0a16b34f\/Core\/HLE\/sceNetAdhoc.cpp#L191\">191<\/a><\/p>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u043c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <code>sock<\/code>. \u041c\u044b \u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u0435\u0451 \u043f\u044b\u0442\u0430\u044e\u0442\u0441\u044f \u043f\u0440\u043e\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u043c \u043c\u0430\u0441\u0441\u0438\u0432\u0430 <code>adHocSockets<\/code> \u0441 \u0438\u043d\u0434\u0435\u043a\u0441\u043e\u043c <code>gameModeSocket - 1<\/code>.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043e\u0431\u0440\u0430\u0442\u0438\u043c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u0432\u044b\u0448\u0435. \u041e\u043d\u0430 \u043e\u0442\u0441\u0435\u0438\u0432\u0430\u0435\u0442 \u0432\u0441\u0435 \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <code>gameModeSocket<\/code>.<\/p>\n<p>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0437\u0430\u0431\u044b\u043b\u0438 \u0443\u0447\u0435\u0441\u0442\u044c \u0441\u043b\u0443\u0447\u0430\u0439, \u043a\u043e\u0433\u0434\u0430 <code>gameModeSocket<\/code> \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0432\u0435\u043d \u043d\u0443\u043b\u044e. \u0422\u043e\u0433\u0434\u0430 \u0438\u043d\u0434\u0435\u043a\u0441 <code>gameModeSocket - 1<\/code> \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c, \u0438 \u044d\u0442\u043e \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u0442 \u043a UB.<\/p>\n<p>\u0418\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"cpp\">if (gameModeSocket &lt;= 0) <\/code><\/pre>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N4<\/strong><\/p>\n<pre><code class=\"cpp\">SoftGPU::SoftGPU(GraphicsContext *gfxCtx, Draw::DrawContext *draw)   : GPUCommon(gfxCtx, draw) {   ....   drawEngine_ = new SoftwareDrawEngine();   if (!drawEngine_)     return;   .... } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V668 There is no sense in testing the &#8216;drawEngine_&#8217; pointer against null, as the memory was allocated using the &#8216;new&#8217; operator. The exception will be generated in the case of memory allocation error. SoftGpu.cpp <a href=\"https:\/\/github.com\/hrydgard\/ppsspp\/blob\/0f50225f8e741c2f8a3a35cfd3b7d9dd0a16b34f\/GPU\/Software\/SoftGpu.cpp#L436\">436<\/a><\/p>\n<p>\u041a\u0430\u043a \u0443\u0436\u0435 \u043a\u0440\u0430\u0441\u043d\u043e\u0440\u0435\u0447\u0438\u0432\u043e \u043f\u043e\u0434\u043c\u0435\u0442\u0438\u043b\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f, \u043d\u0435\u0442 \u0441\u043c\u044b\u0441\u043b\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 <code>new<\/code>. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435\u0445\u0432\u0430\u0442\u043a\u0438 \u043f\u0430\u043c\u044f\u0442\u0438 \u0438\u043b\u0438 \u043a\u0430\u043a\u043e\u0439-\u043b\u0438\u0431\u043e \u0434\u0440\u0443\u0433\u043e\u0439 \u043e\u0448\u0438\u0431\u043a\u0438 \u043e\u043d \u0431\u0440\u043e\u0441\u0438\u0442 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435.<\/p>\n<p>\u0412\u0435\u0440\u043e\u044f\u0442\u043d\u043e, \u0442\u0430\u043a\u043e\u0439 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u0432\u043e\u0437\u043d\u0438\u043a \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433\u0430, \u0430 \u0440\u0430\u043d\u044c\u0448\u0435 \u0437\u0434\u0435\u0441\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f <code>malloc<\/code>.<\/p>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N5<\/strong><\/p>\n<pre><code class=\"cpp\">static std::vector&lt;MicWaitInfo&gt; waitingThreads; .... static void __MicBlockingResume(u64 userdata, int cyclesLate) {   ....   int count = 0;   for (auto waitingThread : waitingThreads)   {     if (waitingThread.threadID == threadID)     {       ....       if (Microphone::isHaveDevice())       {         if (Microphone::getReadMicDataLength() &gt;= waitingThread.needSize)         {           ....           waitingThreads.erase(waitingThreads.begin() + count);    \/\/ &lt;=         }         else         {           ....         }       }        else       {         ....         waitingThreads.erase(waitingThreads.begin() + count);      \/\/ &lt;=         readMicDataLength += waitingThread.needSize;       }     }      ++count;   } } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f PVS-Studio:<\/p>\n<ul>\n<li>\n<p>V789 Iterators for the &#8216;waitingThreads&#8217; container, used in the range-based for loop, become invalid upon the call of the &#8216;erase&#8217; function. sceUsbMic.cpp <a href=\"https:\/\/github.com\/hrydgard\/ppsspp\/blob\/0f50225f8e741c2f8a3a35cfd3b7d9dd0a16b34f\/Core\/HLE\/sceUsbMic.cpp#L73\">73<\/a><\/p>\n<\/li>\n<li>\n<p>V789 Iterators for the &#8216;waitingThreads&#8217; container, used in the range-based for loop, become invalid upon the call of the &#8216;erase&#8217; function. sceUsbMic.cpp 87<\/p>\n<\/li>\n<\/ul>\n<p>\u041e\u0434\u0438\u043d \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u043d\u0435\u043e\u0431\u044b\u0447\u043d\u044b\u0445 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u043f\u0440\u043e\u0441\u0442\u0440\u0435\u043b\u0438\u0442\u044c \u0441\u0435\u0431\u0435 \u043d\u043e\u0433\u0443, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f \u0432\u0438\u0434\u0435\u043b.<\/p>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u043c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u043a\u043e\u0434 <code>waitingThreads.erase(waitingThreads.begin() + count);<\/code>. \u041e\u043d \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432 \u0434\u0432\u0443\u0445 \u043c\u0435\u0441\u0442\u0430\u0445 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0442\u043e\u0433\u043e, \u043f\u043e \u043a\u0430\u043a\u043e\u0439 \u0432\u0435\u0442\u043a\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u0439 \u043c\u044b \u043f\u043e\u0439\u0434\u0451\u043c.<\/p>\n<p>\u0412 \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u043c \u043a\u043e\u0434\u0435 \u043c\u043e\u0436\u0435\u0442 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0443\u0442\u044c \u0440\u044f\u0434 \u043f\u0440\u043e\u0431\u043b\u0435\u043c. \u041f\u043e\u0441\u043b\u0435 \u0442\u0430\u043a\u043e\u0433\u043e \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f <a href=\"https:\/\/en.cppreference.com\/w\/cpp\/container\/vector\/erase#:~:text=Iterators%20(including%20the%20end()%20iterator)%20and%20references%20to%20the%20elements%20at%20or%20after%20the%20point%20of%20the%20erase%20are%20invalidated.\">\u0438\u043d\u0432\u0430\u043b\u0438\u0434\u0438\u0440\u0443\u044e\u0442\u0441\u044f<\/a> \u0432\u0441\u0435 \u0438\u0442\u0435\u0440\u0430\u0442\u043e\u0440\u044b \u0438 \u0441\u0441\u044b\u043b\u043a\u0438 \u0432 \u0442\u043e\u0447\u043a\u0435 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \u0438\u043b\u0438 \u043f\u043e\u0441\u043b\u0435 \u043d\u0435\u0451, \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u0438\u0442\u0435\u0440\u0430\u0442\u043e\u0440 <code>end()<\/code>. \u0422\u043e \u0435\u0441\u0442\u044c \u043f\u0440\u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u043f\u0440\u043e\u0445\u043e\u0434\u0435 \u0446\u0438\u043a\u043b\u0430 \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0443\u0436\u0435 \u043d\u0435\u0432\u0430\u043b\u0438\u0434\u043d\u044b\u0439 \u0438\u0442\u0435\u0440\u0430\u0442\u043e\u0440.<\/p>\n<figure class=\"\"><\/figure>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0442\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u043e\u0439 erase-remove \u0438\u0434\u0438\u043e\u043c\u043e\u0439, \u0430 \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 C++20, \u043f\u043e\u044f\u0432\u0438\u043b\u0438\u0441\u044c <a href=\"https:\/\/en.cppreference.com\/w\/cpp\/container\/vector\/erase2\">std::erase\/std::erase_if<\/a>. \u041d\u043e \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u0445\u043e\u0440\u043e\u0448\u0435\u043d\u044c\u043a\u043e \u043e\u0442\u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u0442\u044c \u043a\u043e\u0434.<\/p>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N6<\/strong><\/p>\n<pre><code class=\"cpp\">void Int_VecDo3(MIPSOpcode op) {   ....   u32 lastsat = (currentMIPS-&gt;vfpuCtrl[VFPU_CTRL_DPREFIX] &amp; 3) &lt;&lt; (n + n - 2);   .... } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438e PVS-Studio: V610 Undefined behavior. Check the shift operator &#8216;&lt;&lt;&#8216;. The right operand is negative (&#8216;(n + n &#8212; 2)&#8217; = [-2..6]). MIPSIntVFPU.cpp <a href=\"https:\/\/github.com\/hrydgard\/ppsspp\/blob\/0f50225f8e741c2f8a3a35cfd3b7d9dd0a16b34f\/Core\/MIPS\/MIPSIntVFPU.cpp#L2155\">2155<\/a><\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043d\u044f\u0442\u044c \u0432 \u0447\u0451\u043c \u0442\u0443\u0442 \u043e\u0448\u0438\u0431\u043a\u0430, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <code>n<\/code>.<\/p>\n<p>\u0412\u043e\u0442 \u043e\u043d\u043e:<\/p>\n<pre><code class=\"cpp\">u32 n = GetNumVectorElements(sz); <\/code><\/pre>\n<p>\u0422\u0430\u043a \u043f\u043e\u0447\u0435\u043c\u0443 \u0436\u0435 \u0440\u0443\u0433\u0430\u0435\u0442\u0441\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440?<\/p>\n<p>\u0412\u0441\u0451 \u0434\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043e\u0442\u0440\u0430\u0431\u043e\u0442\u0430\u043b \u043c\u0435\u0436\u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u043d\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0437. \u041f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>GetNumVectorElements<\/code>, \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0443\u0437\u043d\u0430\u043b, \u0447\u0442\u043e \u043e\u043d\u0430 \u043c\u043e\u0436\u0435\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0435 <code>[0 .. 4]<\/code>.<\/p>\n<p>\u0414\u0430\u043b\u044c\u0448\u0435, \u0443\u0432\u0438\u0434\u0435\u0432, \u0447\u0442\u043e <code>n<\/code> \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u043e \u043a\u043e\u0434\u0443, \u043e\u043d \u043c\u043e\u0436\u0435\u0442 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432\u044b\u0432\u043e\u0434, \u0447\u0442\u043e \u0432 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0438 <code>(n + n - 2)<\/code> \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0439 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 [-2..6].<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 <a href=\"https:\/\/github.com\/hrydgard\/ppsspp\/blob\/fdaf37b9ec468aeb433e425d999cfe691eca0d38\/Core\/MIPS\/MIPS.h#L202\"><code>vpfuCtrl<\/code><\/a>. \u042d\u0442\u043e \u043c\u0430\u0441\u0441\u0438\u0432 32-\u0431\u0438\u0442\u043d\u044b\u0445 \u0431\u0435\u0437\u0437\u043d\u0430\u043a\u043e\u0432\u044b\u0445 \u0447\u0438\u0441\u0435\u043b. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 \u0437\u0434\u0435\u0441\u044c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442 \u043e\u0431\u044b\u0447\u043d\u044b\u0439 \u043f\u043e\u0431\u0438\u0442\u043e\u0432\u044b\u0439 \u0441\u0434\u0432\u0438\u0433 \u0432\u043b\u0435\u0432\u043e \u043d\u0430 -2 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430. \u041a\u0430\u043a \u044d\u0442\u043e? \u0410 <a href=\"https:\/\/en.cppreference.com\/w\/cpp\/language\/operator_arithmetic#Bitwise_shift_operators\">\u043a\u0430\u043a \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f<\/a>.<\/p>\n<p>\u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0435 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f:<\/p>\n<ul>\n<li>\n<p>V610 Undefined behavior. Check the shift operator &#8216;&lt;&lt;&#8216;. The right operand is negative (&#8216;(n &#8212; 1)&#8217; = [-1..3]). MIPSIntVFPU.cpp 2261<\/p>\n<\/li>\n<li>\n<p>V610 Undefined behavior. Check the shift operator &#8216;&lt;&lt;&#8216;. The right operand is negative (&#8216;(n + n &#8212; 2)&#8217; = [-2..6]). MIPSIntVFPU.cpp 2262<\/p>\n<\/li>\n<\/ul>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N7<\/strong><\/p>\n<pre><code class=\"cpp\">inline float Float16ToFloat(float16 ix) {     float x;     memcpy(&amp;x, &amp;ix, sizeof(float));     return x; } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V512 A call of the &#8216;memcpy&#8217; function will lead to the &#8216;&amp; ix&#8217; buffer becoming out of range. math_util.h <a href=\"https:\/\/github.com\/hrydgard\/ppsspp\/blob\/0f50225f8e741c2f8a3a35cfd3b7d9dd0a16b34f\/Common\/Math\/math_util.h#L23\">23<\/a><\/p>\n<p>\u041c\u044b \u043f\u044b\u0442\u0430\u0435\u043c\u0441\u044f \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438\u0437 \u0442\u0438\u043f\u0430 <code>float16<\/code> \u0432 \u0442\u0438\u043f <code>float<\/code>. \u0422\u0438\u043f <code>float16<\/code> \u044d\u0442\u043e <code>unsigned short<\/code>:<\/p>\n<pre><code class=\"cpp\">typedef unsigned short float16; <\/code><\/pre>\n<p>\u0420\u0430\u0437\u043c\u0435\u0440\u044b <code>unsigned short<\/code> \u0438 <code>float<\/code> \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442\u0441\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439, \u043e\u0434\u043d\u0430\u043a\u043e \u043d\u0430 \u043c\u043d\u043e\u0433\u0438\u0445 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430\u0445 \u043e\u043d\u0438 \u0440\u0430\u0432\u043d\u044b 16 \u0438 32 \u0431\u0438\u0442\u0430\u043c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e.<\/p>\n<p>\u0414\u0430\u043b\u044c\u0448\u0435 \u043e\u0431\u0440\u0430\u0442\u0438\u043c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0442\u0440\u0435\u0442\u0438\u0439 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u0432 \u0432\u044b\u0437\u043e\u0432\u0435 <code>memcpy<\/code>. \u041e\u043d \u0433\u043e\u0432\u043e\u0440\u0438\u0442, \u043a\u0430\u043a\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0431\u0430\u0439\u0442\u043e\u0432 \u043d\u0430\u0434\u043e \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0437 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <code>ix<\/code>. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435, \u043a\u043e\u0433\u0434\u0430 \u0440\u0430\u0437\u043c\u0435\u0440 <code>float<\/code> \u0440\u0430\u0432\u0435\u043d 32 \u0431\u0438\u0442\u0430\u043c (4 \u0431\u0430\u0439\u0442\u0430), \u0430 \u0440\u0430\u0437\u043c\u0435\u0440 <code>unsigned short<\/code> 16 \u0431\u0438\u0442\u0430\u043c (2 \u0431\u0430\u0439\u0442\u0430), \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0451\u0442 \u0432\u044b\u0445\u043e\u0434 \u0437\u0430 \u0433\u0440\u0430\u043d\u0438\u0446\u044b \u0431\u0443\u0444\u0435\u0440\u0430 <code>ix<\/code>.<\/p>\n<h4>\u0418\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u044b\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438<\/h4>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N8<\/strong><\/p>\n<pre><code class=\"cpp\">void Jit::Comp_SVQ(MIPSOpcode op) {   CONDITIONAL_DISABLE(LSU_VFPU);    int imm = (signed short)(op&amp;0xFFFC);   int vt = (((op &gt;&gt; 16) &amp; 0x1f)) | ((op&amp;1) &lt;&lt; 5);   MIPSGPReg rs = _RS;    CheckMemoryBreakpoint(0, rs, imm);    switch (op &gt;&gt; 26)   {     case 53: \/\/lvl.q\/lvr.q     {       if (!g_Config.bFastMemory)       {         DISABLE;       }        DISABLE;   .... } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V523 [CWE-691] The &#8216;then&#8217; statement is equivalent to the subsequent code fragment. CompVFPU.cpp <a href=\"https:\/\/github.com\/hrydgard\/ppsspp\/blob\/0f50225f8e741c2f8a3a35cfd3b7d9dd0a16b34f\/Core\/MIPS\/x86\/CompVFPU.cpp#L313\">313<\/a><\/p>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u043c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0432 <em>then<\/em>-\u0432\u0435\u0442\u043a\u0435 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 <code>if<\/code> \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u0442\u0430\u043a\u043e\u0439 \u0436\u0435 \u043a\u043e\u0434, \u043a\u0430\u043a \u0438 \u043f\u043e\u0441\u043b\u0435 \u0441\u0430\u043c\u043e\u0439 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438. \u0410 \u0432\u043e\u0442 \u0447\u0442\u043e \u0438\u0437 \u0441\u0435\u0431\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u0430\u043c \u043c\u0430\u043a\u0440\u043e\u0441 <code>DISABLE<\/code>:<\/p>\n<pre><code class=\"cpp\">#define DISABLE { fpr.ReleaseSpillLocks(); Comp_Generic(op); return; } <\/code><\/pre>\n<p>\u041f\u043e\u043d\u044f<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\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-446691","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/446691","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=446691"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/446691\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=446691"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=446691"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=446691"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}