{"id":253218,"date":"2015-03-17T11:11:08","date_gmt":"2015-03-17T07:11:08","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=253218"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=253218","title":{"rendered":"PVS-Studio: 25 \u043f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u043e\u0432 \u043a\u043e\u0434\u0430 \u0438\u0437 CoreCLR"},"content":{"rendered":"\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/62c\/589\/846\/62c589846b53c11218ca6ac02056d42d.png\" \/><\/div>\n<p>  \u041a\u043e\u0440\u043f\u043e\u0440\u0430\u0446\u0438\u044f Microsoft \u0432\u044b\u043b\u043e\u0436\u0438\u043b\u0430 \u0432 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 \u0434\u043e\u0441\u0442\u0443\u043f \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0434\u0432\u0438\u0436\u043a\u0430 CoreCLR, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u043c .NET Core. \u042d\u0442\u0430 \u043d\u043e\u0432\u043e\u0441\u0442\u044c, \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435, \u043d\u0435 \u043c\u043e\u0433\u043b\u0430 \u043d\u0435 \u043f\u0440\u0438\u0432\u043b\u0435\u0447\u044c \u043d\u0430\u0448\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435. \u0412\u0435\u0434\u044c \u0447\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u0430\u0443\u0434\u0438\u0442\u043e\u0440\u0438\u044f \u0443 \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u0442\u0435\u043c \u0442\u0440\u0435\u0432\u043e\u0436\u043d\u0435\u0435 \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0435 \u043f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043c\u0435\u0441\u0442\u0430. \u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0430\u0432\u0442\u043e\u0440\u0441\u0442\u0432\u043e Microsoft, \u043a\u0430\u043a \u0432 \u043b\u044e\u0431\u043e\u043c \u043a\u0440\u0443\u043f\u043d\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435, \u0442\u0443\u0442 \u0435\u0441\u0442\u044c \u043d\u0430 \u0447\u0442\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0438 \u043d\u0430\u0434 \u0447\u0435\u043c \u0437\u0430\u0434\u0443\u043c\u0430\u0442\u044c\u0441\u044f.<\/p>\n<h2>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h2>\n<p>  <a href=\"https:\/\/github.com\/dotnet\/coreclr\">CoreCLR<\/a> \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0440\u0435\u0434\u043e\u0439 \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f .NET Core, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044f \u0442\u0430\u043a\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043a\u0430\u043a \u0441\u0431\u043e\u0440\u043a\u0443 \u043c\u0443\u0441\u043e\u0440\u0430 \u0438\u043b\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u0432 \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0439 \u043c\u0430\u0448\u0438\u043d\u043d\u044b\u0439 \u043a\u043e\u0434. .Net Core \u2014 \u044d\u0442\u043e \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f .Net, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0430 \u043a\u0430\u043a \u0431\u0430\u0437\u0430 \u0434\u043b\u044f \u043e\u0433\u0440\u043e\u043c\u043d\u043e\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0435\u0432.<\/p>\n<p>  \u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0441 \u043d\u0435\u0434\u0430\u0432\u043d\u0435\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043d\u0430 GitHub \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u043b\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <a href=\"http:\/\/www.viva64.com\/ru\/pvs-studio\/\">PVS-Studio<\/a> 5.23. \u041a\u0430\u043a \u0438 \u044f, \u0436\u0435\u043b\u0430\u044e\u0449\u0438\u0435 \u043c\u043e\u0433\u0443\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043f\u043e\u043b\u043d\u044b\u0439 \u043b\u043e\u0433 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Microsoft Visual Studio Community Edition, \u0432\u044b\u0445\u043e\u0434 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0442\u043e\u0436\u0435 \u0431\u044b\u043b \u043d\u0435\u0434\u0430\u0432\u043d\u0435\u0439 <a href=\"http:\/\/www.viva64.com\/ru\/n\/0102\/\">\u043d\u043e\u0432\u043e\u0441\u0442\u044c\u044e<\/a> \u043e\u0442 Microsoft.<br \/>  <a name=\"habracut\"><\/a><\/p>\n<h2>\u041e\u043f\u0435\u0447\u0430\u0442\u043a\u0438 <\/h2>\n<p>  \u0422\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u043e \u044f \u043d\u0430\u0447\u0438\u043d\u0430\u044e \u0441 \u043c\u0435\u0441\u0442, \u043f\u043e\u0445\u043e\u0436\u0438\u0445 \u043d\u0430 \u043e\u043f\u0435\u0447\u0430\u0442\u043a\u0438. \u0412 \u0443\u0441\u043b\u043e\u0432\u043d\u044b\u0445 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u0445 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u044e\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435, \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b, \u043c\u0430\u043a\u0440\u043e\u0441\u044b \u0438\u043b\u0438 \u043f\u043e\u043b\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\/\u043a\u043b\u0430\u0441\u0441\u043e\u0432. \u041d\u0430\u043b\u0438\u0447\u0438\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u2014 \u043f\u0440\u0435\u0434\u043c\u0435\u0442 \u0434\u0438\u0441\u043a\u0443\u0441\u0441\u0438\u0439, \u0442\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435 \u0442\u0430\u043a\u0438\u0435 \u043c\u0435\u0441\u0442\u0430 \u0431\u044b\u043b\u0438 \u043d\u0430\u0439\u0434\u0435\u043d\u044b \u0438 \u0432\u044b\u0433\u043b\u044f\u0434\u044f\u0442 \u043f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e.<\/p>\n<p>  <a href=\"http:\/\/www.viva64.com\/ru\/d\/0090\/\">V501<\/a> There are identical sub-expressions &#8216;tree-&gt;gtOper == GT_CLS_VAR&#8217; to the left and to the right of the &#8216;||&#8217; operator. ClrJit lsra.cpp 3140  <\/p>\n<pre><code class=\"cpp\">\/\/ register variable  GTNODE(GT_REG_VAR      , &quot;regVar&quot;  ,0,GTK_LEAF|GTK_LOCAL) \/\/ static data member GTNODE(GT_CLS_VAR      , &quot;clsVar&quot;  ,0,GTK_LEAF) \/\/ static data member address GTNODE(GT_CLS_VAR_ADDR , &quot;&amp;clsVar&quot; ,0,GTK_LEAF)            ....  void  LinearScan::buildRefPositionsForNode(GenTree *tree, ....) {   ....   if ((tree-&gt;gtOper == GT_CLS_VAR ||        tree-&gt;gtOper == GT_CLS_VAR) &amp;&amp; i == 1)   {       registerType = TYP_PTR;       currCandidates = allRegs(TYP_PTR);   }   .... }<\/code><\/pre>\n<p>  \u0425\u043e\u0442\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 &#8216;GenTree&#8217; \u0438\u043c\u0435\u0435\u0442 \u043f\u043e\u0445\u043e\u0436\u0435\u0435 \u043f\u043e \u0438\u043c\u0435\u043d\u0438 \u043f\u043e\u043b\u0435 \u00abtree-&gt;gtType\u00bb, \u043d\u043e \u043e\u043d\u043e \u0438\u043c\u0435\u0435\u0442 \u0434\u0440\u0443\u0433\u043e\u0439 \u0442\u0438\u043f \u0441 \u00abtree-&gt;gtOper\u00bb. \u0414\u0443\u043c\u0430\u044e, \u0437\u0434\u0435\u0441\u044c \u0434\u0435\u043b\u043e \u0432 \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0435. \u0422\u043e-\u0435\u0441\u0442\u044c \u0432 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0438 \u0434\u043e\u043b\u0436\u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0435\u0449\u0451 \u043e\u0434\u043d\u0430 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0430, \u043f\u043e\u043c\u0438\u043c\u043e GT_CLS_VAR. <\/p>\n<p>  <a href=\"http:\/\/www.viva64.com\/ru\/d\/0090\/\">V501<\/a> There are identical sub-expressions &#8216;DECODE_PSP_SYM&#8217; to the left and to the right of the &#8216;|&#8217; operator. daccess 264  <\/p>\n<pre><code class=\"cpp\">enum GcInfoDecoderFlags {     DECODE_SECURITY_OBJECT       = 0x01,     DECODE_CODE_LENGTH           = 0x02,     DECODE_VARARG                = 0x04,     DECODE_INTERRUPTIBILITY      = 0x08,     DECODE_GC_LIFETIMES          = 0x10,     DECODE_NO_VALIDATION         = 0x20,     DECODE_PSP_SYM               = 0x40,     DECODE_GENERICS_INST_CONTEXT = 0x80,     DECODE_GS_COOKIE             = 0x100,        DECODE_FOR_RANGES_CALLBACK   = 0x200,     DECODE_PROLOG_LENGTH         = 0x400,     DECODE_EDIT_AND_CONTINUE     = 0x800, };  size_t GCDump::DumpGCTable(PTR_CBYTE table, ....) {   GcInfoDecoder hdrdecoder(table,    (GcInfoDecoderFlags)(  DECODE_SECURITY_OBJECT                         | DECODE_GS_COOKIE                         | DECODE_CODE_LENGTH                         | DECODE_PSP_SYM                \/\/&lt;==1                         | DECODE_VARARG                         | DECODE_PSP_SYM                \/\/&lt;==1                         | DECODE_GENERICS_INST_CONTEXT  \/\/&lt;==2                         | DECODE_GC_LIFETIMES                         | DECODE_GENERICS_INST_CONTEXT  \/\/&lt;==2                         | DECODE_PROLOG_LENGTH),    0);   .... }<\/code><\/pre>\n<p>  \u0422\u0443\u0442 \u0434\u0430\u0436\u0435 \u0434\u0432\u0435 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u044e\u0449\u0438\u0435\u0441\u044f \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b, \u0445\u043e\u0442\u044f \u0432 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0438 &quot; GcInfoDecoderFlags&quot; \u0435\u0441\u0442\u044c \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432 \u0443\u0441\u043b\u043e\u0432\u0438\u0438 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f.<\/p>\n<p>  \u0415\u0449\u0451 \u043f\u043e\u0445\u043e\u0436\u0438\u0435 \u043c\u0435\u0441\u0442\u0430:<\/p>\n<ul>\n<li>V501 There are identical sub-expressions &#8216;varLoc1.vlStk2.vls2BaseReg&#8217; to the left and to the right of the &#8216;==&#8217; operator. cee_wks util.cpp 657<\/li>\n<li>V501 There are identical sub-expressions &#8216;varLoc1.vlStk2.vls2Offset&#8217; to the left and to the right of the &#8216;==&#8217; operator. cee_wks util.cpp 658<\/li>\n<li>V501 There are identical sub-expressions &#8216;varLoc1.vlFPstk.vlfReg&#8217; to the left and to the right of the &#8216;==&#8217; operator. cee_wks util.cpp 661<\/li>\n<\/ul>\n<p>  <a href=\"http:\/\/www.viva64.com\/ru\/d\/0339\/\">V700<\/a> Consider inspecting the &#8216;T foo = foo = &#8230;&#8217; expression. It is odd that variable is initialized through itself. cee_wks zapsig.cpp 172  <\/p>\n<pre><code class=\"cpp\">BOOL ZapSig::GetSignatureForTypeHandle(....) {   ....   CorElementType elemType = elemType =     TryEncodeUsingShortcut(pMT);   .... }<\/code><\/pre>\n<p>  \u0412\u0440\u043e\u0434\u0435 \u0431\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u043b\u0438\u0448\u043d\u0435\u0435 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u0435, \u043d\u043e \u0442\u0430\u043a\u0438\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u0447\u0430\u0441\u0442\u043e \u0434\u0435\u043b\u0430\u044e\u0442 \u043f\u0440\u0438 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u043a\u043e\u0434\u0430 \u0438 \u0437\u0430\u0431\u044b\u0432\u0430\u044e\u0442 \u0447\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u0442\u044c. \u0412 \u043b\u044e\u0431\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0432 \u0442\u0430\u043a\u043e\u043c \u0432\u0438\u0434\u0435 \u043a\u043e\u0434 \u0431\u0435\u0441\u0441\u043c\u044b\u0441\u043b\u0435\u043d\u043d\u044b\u0439.<\/p>\n<p>  <a href=\"http:\/\/www.viva64.com\/ru\/d\/0112\/\">V523<\/a> The &#8216;then&#8217; statement is equivalent to the &#8216;else&#8217; statement. cee_wks threadsuspend.cpp 2468  <\/p>\n<pre><code class=\"cpp\">enum __MIDL___MIDL_itf_mscoree_0000_0004_0001 {   OPR_ThreadAbort = 0,   OPR_ThreadRudeAbortInNonCriticalRegion = .... ,   OPR_ThreadRudeAbortInCriticalRegion = ....) ,   OPR_AppDomainUnload = .... ,   OPR_AppDomainRudeUnload = ( OPR_AppDomainUnload + 1 ) ,   OPR_ProcessExit = ( OPR_AppDomainRudeUnload + 1 ) ,   OPR_FinalizerRun = ( OPR_ProcessExit + 1 ) ,   MaxClrOperation = ( OPR_FinalizerRun + 1 )  }  EClrOperation;  void Thread::SetRudeAbortEndTimeFromEEPolicy() {   LIMITED_METHOD_CONTRACT;   DWORD timeout;   if (HasLockInCurrentDomain())   {     timeout = GetEEPolicy()-&gt;       GetTimeout(OPR_ThreadRudeAbortInCriticalRegion);  \/\/&lt;==   }   else   {     timeout = GetEEPolicy()-&gt;       GetTimeout(OPR_ThreadRudeAbortInCriticalRegion);  \/\/&lt;==   }   .... }<\/code><\/pre>\n<p>  \u0414\u0430\u043d\u043d\u0430\u044f \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0430 \u043d\u0430\u0445\u043e\u0434\u0438\u0442 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0435 \u0431\u043b\u043e\u043a\u0438 \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f\u0445 if\/else. \u0418 \u0437\u0434\u0435\u0441\u044c \u0442\u043e\u0436\u0435 \u0435\u0441\u0442\u044c \u043f\u043e\u0434\u043e\u0437\u0440\u0435\u043d\u0438\u0435 \u043d\u0430 \u043e\u043f\u0435\u0447\u0430\u0442\u043a\u0443 \u0432 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0435. \u0412 \u043f\u0435\u0440\u0432\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u043f\u043e \u0441\u043c\u044b\u0441\u043b\u0443 \u043a\u0430\u043a \u0440\u0430\u0437 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u00abOPR_ThreadRudeAbortInNonCriticalRegion\u00bb.<\/p>\n<p>  \u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0435 \u043c\u0435\u0441\u0442\u0430:<\/p>\n<ul>\n<li>V523 The &#8216;then&#8217; statement is equivalent to the &#8216;else&#8217; statement. ClrJit instr.cpp 3427<\/li>\n<li>V523 The &#8216;then&#8217; statement is equivalent to the &#8216;else&#8217; statement. ClrJit flowgraph.cpp 18815<\/li>\n<li>V523 The &#8216;then&#8217; statement is equivalent to the &#8216;else&#8217; statement. daccess dacdbiimpl.cpp 6374<\/li>\n<\/ul>\n<p>  <\/p>\n<h2>\u0421\u043f\u0438\u0441\u043e\u043a \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430<\/h2>\n<p>  <a href=\"http:\/\/www.viva64.com\/ru\/d\/0300\/\">V670<\/a> The uninitialized class member &#8216;gcInfo&#8217; is used to initialize the &#8216;regSet&#8217; member. Remember that members are initialized in the order of their declarations inside a class. ClrJit codegencommon.cpp 92  <\/p>\n<pre><code class=\"cpp\">CodeGenInterface *getCodeGenerator(Compiler *comp);  class CodeGenInterface {     friend class emitter;  public:     ....     RegSet  regSet; \/\/&lt;=== line 91     .... public:     GCInfo  gcInfo; \/\/&lt;=== line 322 .... };  \/\/ CodeGen constructor CodeGenInterface::CodeGenInterface(Compiler* theCompiler) :     compiler(theCompiler),     gcInfo(theCompiler),     regSet(theCompiler, gcInfo) { }<\/code><\/pre>\n<p>  \u0421\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0443, \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0447\u043b\u0435\u043d\u043e\u0432 \u043a\u043b\u0430\u0441\u0441\u0430 \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432 \u043f\u043e\u0440\u044f\u0434\u043a\u0435 \u0438\u0445 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u0432 \u043a\u043b\u0430\u0441\u0441\u0435. \u0414\u043b\u044f \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043e\u0448\u0438\u0431\u043a\u0438 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u0442\u0438 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u0447\u043b\u0435\u043d\u0430 \u043a\u043b\u0430\u0441\u0441\u0430 &#8216;gcInfo&#8217; \u0432\u044b\u0448\u0435 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u044f &#8216;regSet&#8217;.<\/p>\n<h2>\u041b\u043e\u0436\u043d\u043e\u0435, \u043d\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0435 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435<\/h2>\n<p>  V705 It is possible that &#8216;else&#8217; block was forgotten or commented out, thus altering the program&#8217;s operation logics. daccess daccess.cpp 2979  <\/p>\n<pre><code class=\"cpp\">HRESULT Initialize() {   if (hdr.dwSig == sig)   {       m_rw = eRO;       m_MiniMetaDataBuffSizeMax = hdr.dwTotalSize;       hr = S_OK;   }   else   \/\/ when the DAC initializes this for the case where the target is    \/\/ (a) a live process, or (b) a full dump, buff will point to a   \/\/ zero initialized memory region (allocated w\/ VirtualAlloc)   if (hdr.dwSig == 0 &amp;&amp; hdr.dwTotalSize == 0 &amp;&amp; hdr.dwCntStreams == 0)   {       hr = S_OK;   }   \/\/ otherwise we may have some memory corruption. treat this as   \/\/ a liveprocess\/full dump   else   {       hr = S_FALSE;   }   .... }<\/code><\/pre>\n<p>  \u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b \u043f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u043c\u0435\u0441\u0442\u043e \u0432 \u043a\u043e\u0434\u0435. \u0417\u0434\u0435\u0441\u044c \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u043a\u043e\u0434 \u041f\u0420\u041e\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d \u0438 \u0432\u0441\u0451 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e. \u041d\u043e \u0442\u0430\u043a\u043e\u0433\u043e \u0442\u0438\u043f\u0430 \u043e\u0448\u0438\u0431\u043a\u0438 \u043e\u0447\u0435\u043d\u044c \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u044b, \u043a\u043e\u0433\u0434\u0430 \u043a\u043e\u0434 \u043f\u043e\u0441\u043b\u0435 &#8216;else&#8217; \u0417\u0410\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d \u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0437\u0430 \u043d\u0438\u043c \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0447\u0430\u0441\u0442\u044c\u044e \u0443\u0441\u043b\u043e\u0432\u0438\u044f. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043d\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0438, \u043d\u043e \u0435\u0451 \u0432\u043f\u043e\u043b\u043d\u0435 \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043f\u0440\u0438 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u044d\u0442\u043e\u0433\u043e \u043c\u0435\u0441\u0442\u0430 \u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u043c.<\/p>\n<h2>64-\u0431\u0438\u0442\u043d\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430<\/h2>\n<p>  <a href=\"http:\/\/www.viva64.com\/ru\/d\/0306\/\">V673<\/a> The &#8216;0xefefefef &lt;&lt; 28&#8217; expression evaluates to 1080581331517177856. 60 bits are required to store the value, but the expression evaluates to the &#8216;unsigned&#8217; type which can only hold &#8217;32&#8217; bits. cee_dac _dac object.inl 95  <\/p>\n<pre><code class=\"cpp\">inline void Object::EnumMemoryRegions(void) {   ....   SIZE_T size = sizeof(ObjHeader) + sizeof(Object);   ....   size |= 0xefefefef &lt;&lt; 28;   .... }<\/code><\/pre>\n<p>  \u041f\u0440\u043e \u0442\u0435\u0440\u043c\u0438\u043d \u00ab64-\u0431\u0438\u0442\u043d\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430\u00bb \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0435\u0441\u0442\u044c <a href=\"http:\/\/www.viva64.com\/ru\/t\/0002\/\">\u0437\u0434\u0435\u0441\u044c<\/a>. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435, \u043f\u043e\u0441\u043b\u0435 \u0441\u0434\u0432\u0438\u0433\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u00absize |= 0xf0000000\u00bb \u0432 32-\u0445 \u0431\u0438\u0442\u043d\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435 \u0438 \u00absize |= 0x00000000f0000000\u00bb \u0432 64-\u0445 \u0431\u0438\u0442\u043d\u043e\u0439. \u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u0432 64-\u0445 \u0431\u0438\u0442\u043d\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0442\u044c: \u00absize |= 0x0efefefef0000000\u00bb. \u041d\u043e \u0433\u0434\u0435 \u0436\u0435 \u0442\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u0441\u0442\u0430\u0440\u0448\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0447\u0438\u0441\u043b\u0430?<\/p>\n<p>  \u0427\u0438\u0441\u043b\u043e \u00ab0xefefefef\u00bb \u0438\u043c\u0435\u0435\u0442 \u0442\u0438\u043f &#8216;unsigned&#8217;, \u0442\u0430\u043a \u043a\u0430\u043a \u043d\u0435 \u043f\u043e\u043c\u0435\u0449\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u0438\u043f &#8216;int&#8217;. \u0412\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0441\u0434\u0432\u0438\u0433 32-\u0445 \u0431\u0438\u0442\u043d\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430 \u0438 \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c 0xf0000000 \u0431\u0435\u0437\u0437\u043d\u0430\u043a\u043e\u0432\u043e\u0433\u043e \u0442\u0438\u043f\u0430. \u0414\u0430\u043b\u0435\u0435 \u044d\u0442\u043e \u0431\u0435\u0437\u0437\u043d\u0430\u043a\u043e\u0432\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u0438\u0442\u0441\u044f \u0434\u043e SIZE_T \u0438 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c 0x00000000f0000000.<\/p>\n<p>  \u0414\u043b\u044f \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u044f\u0432\u043d\u043e\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0442\u0438\u043f\u0430. \u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430:  <\/p>\n<pre><code class=\"cpp\">inline void Object::EnumMemoryRegions(void) {   ....   SIZE_T size = sizeof(ObjHeader) + sizeof(Object);   ....   size |= SIZE_T(0xefefefef) &lt;&lt; 28;   .... }<\/code><\/pre>\n<p>  \u0415\u0449\u0451 \u0442\u0430\u043a\u043e\u0435 \u043c\u0435\u0441\u0442\u043e:<\/p>\n<ul>\n<li>V673 The &#8216;0xefefefef &lt;&lt; 28&#8217; expression evaluates to 1080581331517177856. 60 bits are required to store the value, but the expression evaluates to the &#8216;unsigned&#8217; type which can only hold &#8217;32&#8217; bits. cee_dac dynamicmethod.cpp 807<\/li>\n<\/ul>\n<p>  <\/p>\n<h2>\u041a\u043e\u0434 \u00ab\u0432 \u043e\u0442\u0441\u0442\u0430\u0432\u043a\u0435\u00bb<\/h2>\n<p>  \u041f\u043e\u0440\u043e\u0439 \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u043f\u0438\u0448\u0443\u0442\u0441\u044f \u0442\u0430\u043a, \u0447\u0442\u043e \u0431\u0443\u043a\u0432\u0430\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0442\u0438\u0432\u043e\u0440\u0435\u0447\u0430\u0442 \u0434\u0440\u0443\u0433 \u0434\u0440\u0443\u0433\u0443. <\/p>\n<p>  <a href=\"http:\/\/www.viva64.com\/ru\/d\/0255\/\">V637<\/a> Two opposite conditions were encountered. The second condition is always false. Check lines: 31825, 31827. cee_wks gc.cpp 31825  <\/p>\n<pre><code class=\"cpp\">void gc_heap::verify_heap (BOOL begin_gc_p) {   ....   if (brick_table [curr_brick] &lt; 0)   {     if (brick_table [curr_brick] == 0)     {       dprintf(3, (&quot;curr_brick %Ix for object %Ix set to 0&quot;,               curr_brick, (size_t)curr_object));       FATAL_GC_ERROR();     }     ....   }   .... }<\/code><\/pre>\n<p>  \u041a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435, \u043d\u043e \u043e\u043d \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043d\u0435 \u0442\u0430\u043a\u0438\u043c \u0437\u043d\u0430\u0447\u0438\u043c\u044b\u043c, \u043a\u0430\u043a \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435:<\/p>\n<p>  <a href=\"http:\/\/www.viva64.com\/ru\/d\/0106\/\">V517<\/a> The use of &#8216;if (A) {&#8230;} else if (A) {&#8230;}&#8217; pattern was detected. There is a probability of logical error presence. Check lines: 2353, 2391. utilcode util.cpp 2353  <\/p>\n<pre><code class=\"cpp\">void  PutIA64Imm22(UINT64 * pBundle, UINT32 slot, INT32 imm22) {   if (slot == 0)   {     const UINT64 mask0 = UI64(0xFFFFFC000603FFFF);     \/* Clear all bits used as part of the imm22 *\/     pBundle[0] &amp;= mask0;      UINT64 temp0;          temp0  = (UINT64) (imm22 &amp; 0x200000) &lt;&lt; 20;     \/\/  1 s     temp0 |= (UINT64) (imm22 &amp; 0x1F0000) &lt;&lt; 11;     \/\/  5 imm5c     temp0 |= (UINT64) (imm22 &amp; 0x00FF80) &lt;&lt; 25;     \/\/  9 imm9d     temp0 |= (UINT64) (imm22 &amp; 0x00007F) &lt;&lt; 18;     \/\/  7 imm7b          \/* Or in the new bits used in the imm22 *\/     pBundle[0] |= temp0;   }   else if (slot == 1)   {     ....   }   else if (slot == 0)        \/\/&lt;==   {     const UINT64 mask1 = UI64(0xF000180FFFFFFFFF);     \/* Clear all bits used as part of the imm22 *\/     pBundle[1] &amp;= mask1;      UINT64 temp1;          temp1  = (UINT64) (imm22 &amp; 0x200000) &lt;&lt; 37;     \/\/  1 s     temp1 |= (UINT64) (imm22 &amp; 0x1F0000) &lt;&lt; 32;     \/\/  5 imm5c     temp1 |= (UINT64) (imm22 &amp; 0x00FF80) &lt;&lt; 43;     \/\/  9 imm9d     temp1 |= (UINT64) (imm22 &amp; 0x00007F) &lt;&lt; 36;     \/\/  7 imm7b          \/* Or in the new bits used in the imm22 *\/     pBundle[1] |= temp1;   }   FlushInstructionCache(GetCurrentProcess(),pBundle,16); }<\/code><\/pre>\n<p>  \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043e\u0447\u0435\u043d\u044c \u0432\u0430\u0436\u043d\u044b\u0439 \u043a\u043e\u0434 \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0438\u0437-\u0437\u0430 \u043e\u0448\u0438\u0431\u043a\u0438 \u0432 \u043a\u0430\u0441\u043a\u0430\u0434\u0435 \u0443\u0441\u043b\u043e\u0432\u043d\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432.<\/p>\n<p>  \u0415\u0449\u0451 \u043f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043c\u0435\u0441\u0442\u0430:<\/p>\n<ul>\n<li>V637 Two opposite conditions were encountered. The second condition is always false. Check lines: 2898, 2900. daccess nidump.cpp 2898<\/li>\n<li>V637 Two opposite conditions were encountered. The second condition is always false. Check lines: 337, 339. utilcode prettyprintsig.cpp 337<\/li>\n<li>V637 Two opposite conditions were encountered. The second condition is always false. Check lines: 774, 776. utilcode prettyprintsig.cpp 774<\/li>\n<\/ul>\n<p>  <\/p>\n<h2>\u041d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h2>\n<p>  <a href=\"http:\/\/www.viva64.com\/ru\/d\/0225\/\">V610<\/a> Undefined behavior. Check the shift operator &#8216;&lt;&lt;&#8216;. The left operand &#8216;-1&#8217; is negative. bcltype metamodel.h 532  <\/p>\n<pre><code class=\"cpp\">inline static mdToken decodeToken(....) {     \/\/&lt;TODO&gt;@FUTURE: make compile-time calculation&lt;\/TODO&gt;     ULONG32 ix = (ULONG32)(val &amp; ~(-1 &lt;&lt; m_cb[cTokens]));      if (ix &gt;= cTokens)         return rTokens[0];     return TokenFromRid(val &gt;&gt; m_cb[cTokens], rTokens[ix]); }<\/code><\/pre>\n<p>  \u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e \u0441\u0434\u0432\u0438\u0433\u0430 \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u043c\u0443 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044e.<\/p>\n<p>  V610 Undefined behavior. Check the shift operator &#8216;&lt;&lt;&#8216;. The left operand &#8216;(~0)&#8217; is negative. cee_dac decodemd.cpp 456  <\/p>\n<pre><code class=\"cpp\">#define bits_generation 2 #define generation_mask (~(~0 &lt;&lt; bits_generation))  #define MASK(len) (~((~0)&lt;&lt;len)) #define MASK64(len) ((~((~((unsigned __int64)0))&lt;&lt;len)))  void Encoder::Add(unsigned value, unsigned length) {   ....   value = (value &amp; MASK(length));   .... }<\/code><\/pre>\n<p>  \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044e \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 V610 \u044f \u043d\u0430\u0448\u0451\u043b \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0445 \u043c\u0430\u043a\u0440\u043e\u0441\u043e\u0432. &#8216;~0&#8217; \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043a \u0437\u043d\u0430\u043a\u043e\u0432\u043e\u043c\u0443 \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u043c\u0443 \u0447\u0438\u0441\u043b\u0443 \u0442\u0438\u043f\u0430 int, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0441\u0434\u0432\u0438\u0433. \u041a\u0430\u043a \u0432 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u043c\u0430\u043a\u0440\u043e\u0441\u043e\u0432, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u044f\u0432\u043d\u043e\u0435 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043a unsigned:  <\/p>\n<pre><code class=\"cpp\">#define bits_generation 2 #define generation_mask (~(~((unsigned int)0) &lt;&lt; bits_generation))  #define MASK(len) (~((~((unsigned int)0))&lt;&lt;len)) #define MASK64(len) ((~((~((unsigned __int64)0))&lt;&lt;len)))<\/code><\/pre>\n<p>  <\/p>\n<h2>\u041d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0439 sizeof(xx)<\/h2>\n<p>  <a href=\"http:\/\/www.viva64.com\/ru\/d\/0181\/\">V579<\/a> The DacReadAll function receives the pointer and its size as arguments. It is possibly a mistake. Inspect the third argument. daccess dacimpl.h 1688  <\/p>\n<pre><code class=\"cpp\">template&lt;class T&gt; inline bool MisalignedRead(CORDB_ADDRESS addr, T *t) {   return SUCCEEDED(DacReadAll(TO_TADDR(addr), t, sizeof(t), false)); }<\/code><\/pre>\n<p>  \u0412\u043e\u0442 \u0442\u0430\u043a\u0430\u044f \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u0435\u0440\u0451\u0442 \u0440\u0430\u0437\u043c\u0435\u0440 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f. \u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u0442\u0443\u0442 \u0445\u043e\u0442\u0435\u043b\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u00absizeof(*t)\u00bb, \u043d\u0443 \u0438\u043b\u0438 \u00absizeof(T)\u00bb.<\/p>\n<p>  \u0415\u0449\u0451 \u043e\u0434\u0438\u043d \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440\u0447\u0438\u043a:<\/p>\n<p>  <a href=\"http:\/\/www.viva64.com\/ru\/d\/0181\/\">V579<\/a> The Read function receives the pointer and its size as arguments. It is possibly a mistake. Inspect the third argument. util.cpp 4943  <\/p>\n<pre><code class=\"cpp\">HRESULT GetMTOfObject(TADDR obj, TADDR *mt) {   if (!mt)     return E_POINTER;    HRESULT hr = rvCache-&gt;Read(obj, mt, sizeof(mt), NULL);   if (SUCCEEDED(hr))     *mt &amp;= ~3;    return hr; }<\/code><\/pre>\n<h2>\u0421\u0435\u043c\u0435\u0439\u0441\u0442\u0432\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u00abmemFAIL\u00bb<\/h2>\n<p>  \u0421 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c memXXX-\u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0441\u0430\u043c\u044b\u0435 \u0440\u0430\u0437\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438. \u0414\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u0442\u0430\u043a\u0438\u0445 \u043c\u0435\u0441\u0442 \u0432 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0435 \u0435\u0441\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043f\u0440\u0430\u0432\u0438\u043b.<\/p>\n<p>  <a href=\"http:\/\/www.viva64.com\/ru\/d\/0101\/\">V512<\/a> A call of the &#8216;memset&#8217; function will lead to underflow of the buffer &#8216;pAddExpression&#8217;. sos strike.cpp 11973  <\/p>\n<pre><code class=\"cpp\">DECLARE_API(Watch) {   ....   if(addExpression.data != NULL || aExpression.data != NULL)   {     WCHAR pAddExpression[MAX_EXPRESSION];     memset(pAddExpression, 0, MAX_EXPRESSION);     swprintf_s(pAddExpression, MAX_EXPRESSION, L&quot;%S&quot;, ....);     Status = g_watchCmd.Add(pAddExpression);   }   .... }<\/code><\/pre>\n<p>  \u0420\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0451\u043d\u043d\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430, \u043a\u043e\u0433\u0434\u0430 \u0437\u0430\u0431\u044b\u0432\u0430\u044e\u0442 \u0434\u0435\u043b\u0430\u0442\u044c \u043f\u043e\u043f\u0440\u0430\u0432\u043a\u0443 \u043d\u0430 \u0440\u0430\u0437\u043c\u0435\u0440 \u0442\u0438\u043f\u0430:  <\/p>\n<pre><code class=\"cpp\">WCHAR pAddExpression[MAX_EXPRESSION]; memset(pAddExpression, 0, sizeof(WCHAR)*MAX_EXPRESSION);<\/code><\/pre>\n<p>  \u0415\u0449\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0442\u0430\u043a\u0438\u0445 \u043c\u0435\u0441\u0442:<\/p>\n<ul>\n<li>V512 A call of the &#8216;memset&#8217; function will lead to underflow of the buffer &#8216;pSaveName&#8217;. sos strike.cpp 11997<\/li>\n<li>V512 A call of the &#8216;memset&#8217; function will lead to underflow of the buffer &#8216;pOldName&#8217;. sos strike.cpp 12013<\/li>\n<li>V512 A call of the &#8216;memset&#8217; function will lead to underflow of the buffer &#8216;pNewName&#8217;. sos strike.cpp 12016<\/li>\n<li>V512 A call of the &#8216;memset&#8217; function will lead to underflow of the buffer &#8216;pExpression&#8217;. sos strike.cpp 12024<\/li>\n<li>V512 A call of the &#8216;memset&#8217; function will lead to underflow of the buffer &#8216;pFilterName&#8217;. sos strike.cpp 12039<\/li>\n<\/ul>\n<p>  <a href=\"http:\/\/www.viva64.com\/ru\/d\/0209\/\">V598<\/a> The &#8216;memcpy&#8217; function is used to copy the fields of &#8216;GenTree&#8217; class. Virtual table pointer will be damaged by this. ClrJit compiler.hpp 1344  <\/p>\n<pre><code class=\"cpp\">struct GenTree {   ....   #if DEBUGGABLE_GENTREE     virtual void DummyVirt() {}   #endif \/\/ DEBUGGABLE_GENTREE   .... };  void GenTree::CopyFrom(const GenTree* src, Compiler* comp) {   ....   memcpy(this, src, src-&gt;GetNodeSize());   .... }<\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u043f\u0440\u0435\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430 &#8216;DEBUGGABLE_GENTREE&#8217;, \u0442\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f. \u0422\u043e\u0433\u0434\u0430 \u043a\u043b\u0430\u0441\u0441 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0438 \u0435\u0433\u043e \u0443\u0436\u0435 \u043d\u0435\u043b\u044c\u0437\u044f \u0432\u043e\u0442 \u0442\u0430\u043a \u043f\u0440\u043e\u0441\u0442\u043e \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c.<\/p>\n<p>  <a href=\"http:\/\/www.viva64.com\/ru\/d\/0209\/\">V598<\/a> The &#8216;memcpy&#8217; function is used to copy the fields of &#8216;GCStatistics&#8217; class. Virtual table pointer will be damaged by this. cee_wks gc.cpp 287  <\/p>\n<pre><code class=\"cpp\">struct GCStatistics     : public StatisticsBase {   ....   virtual void Initialize();   virtual void DisplayAndUpdate();   .... };  GCStatistics g_LastGCStatistics;  void GCStatistics::DisplayAndUpdate() {   ....   memcpy(&amp;g_LastGCStatistics, this, sizeof(g_LastGCStatistics));   .... }<\/code><\/pre>\n<p>  \u0412 \u044d\u0442\u043e\u043c \u043c\u0435\u0441\u0442\u0435 \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0435 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u043e\u0442\u043b\u0430\u0434\u043a\u0438.<\/p>\n<p>  <a href=\"http:\/\/www.viva64.com\/ru\/d\/0337\/\">V698<\/a> Expression &#8216;memcmp(&#8230;.) == -1&#8217; is incorrect. This function can return not only the value &#8216;-1&#8217;, but any negative value. Consider using &#8216;memcmp(&#8230;.) &lt; 0&#8217; instead. sos util.cpp 142  <\/p>\n<pre><code class=\"cpp\">bool operator( )(const GUID&amp; _Key1, const GUID&amp; _Key2) const   { return memcmp(&amp;_Key1, &amp;_Key2, sizeof(GUID)) == -1; }<\/code><\/pre>\n<p>  \u0421\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 &#8216;memcmp&#8217; \u0441\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c 1 \u0438\u043b\u0438 -1 \u043d\u0435 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e. \u0420\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c \u0442\u0430\u043a\u0438\u0445 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0439 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a, \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430, \u0435\u0433\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a, \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u0435\u0451 \u0440\u0430\u0437\u0440\u044f\u0434\u043d\u043e\u0441\u0442\u0438 \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435; \u0432 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u043e\u0434\u043d\u043e \u0438\u0437 \u0442\u0440\u0451\u0445 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439: &#8216;&lt; 0&#8217;, &#8216;0&#8217; \u0438\u043b\u0438 &#8216;&gt; 0&#8217;.<\/p>\n<p>  \u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e\u0435 \u043c\u0435\u0441\u0442\u043e:<\/p>\n<ul>\n<li>V698 Expression &#8216;wcscmp(&#8230;.) == -1&#8217; is incorrect. This function can return not only the value &#8216;-1&#8217;, but any negative value. Consider using &#8216;wcscmp(&#8230;.) &lt; 0&#8217; instead. sos strike.cpp 3855<\/li>\n<\/ul>\n<p>  <\/p>\n<h2>\u041f\u0440\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438<\/h2>\n<p>  <a href=\"http:\/\/www.viva64.com\/ru\/d\/0111\/\">V522<\/a> Dereferencing of the null pointer &#8216;hp&#8217; might take place. cee_wks gc.cpp 4488  <\/p>\n<pre><code class=\"cpp\">heap_segment* gc_heap::get_segment_for_loh (size_t size #ifdef MULTIPLE_HEAPS                                            , gc_heap* hp #endif \/\/MULTIPLE_HEAPS                                            ) { #ifndef MULTIPLE_HEAPS     gc_heap* hp = 0; #endif \/\/MULTIPLE_HEAPS     heap_segment* res = hp-&gt;get_segment (size, TRUE);   .... }<\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 &#8216;MULTIPLE_HEAPS&#8217; \u043d\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d, \u0442\u043e \u0431\u0435\u0434\u0430. \u0423\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u0440\u0430\u0432\u0435\u043d \u043d\u0443\u043b\u044e.<\/p>\n<p>  <a href=\"http:\/\/www.viva64.com\/ru\/d\/0205\/\">V595<\/a> The &#8216;tree&#8217; pointer was utilized before it was verified against nullptr. Check lines: 6970, 6976. ClrJit gentree.cpp 6970  <\/p>\n<pre><code class=\"cpp\">void Compiler::gtDispNode(GenTreePtr tree, ....) {   ....   if (tree-&gt;gtOper &gt;= GT_COUNT)   {     printf(&quot; **** ILLEGAL NODE ****&quot;);     return;   }    if  (tree &amp;&amp; printFlags)   {     \/* First print the flags associated with the node *\/     switch (tree-&gt;gtOper)     {       ....     }     ....   }   .... }<\/code><\/pre>\n<p>  \u0412 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u043c \u043a\u043e\u0434\u0435 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u044b \u043c\u0435\u0441\u0442\u0430, \u043a\u043e\u0433\u0434\u0430 \u0432\u0430\u043b\u0438\u0434\u043d\u043e\u0441\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f \u0442\u0430\u043a\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f, \u043d\u043e \u0443\u0436\u0435 \u043f\u043e\u0441\u043b\u0435 \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u044f.<\/p>\n<p>  \u0412\u0435\u0441\u044c \u0441\u043f\u0438\u0441\u043e\u043a: <a href=\"http:\/\/www.viva64.com\/external-pictures\/txt\/CoreCLR_V595.txt\">CoreCLR_V595.txt<\/a>.<\/p>\n<h2>\u041b\u0438\u0448\u043d\u0438\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438<\/h2>\n<p>  \u0414\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u043b\u0438\u0448\u043d\u0438\u0439 \u043a\u043e\u0434 \u043d\u0435 \u043d\u0430\u043d\u043e\u0441\u0438\u0442 \u0432\u0440\u0435\u0434\u0430, \u0442\u043e \u0435\u0433\u043e \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0442\u0432\u043b\u0435\u043a\u0430\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043e\u0442 \u0431\u043e\u043b\u0435\u0435 \u0432\u0430\u0436\u043d\u044b\u0445 \u043c\u0435\u0441\u0442.<\/p>\n<p>  <a href=\"http:\/\/www.viva64.com\/ru\/d\/0092\/\">V503<\/a> This is a nonsensical comparison: pointer &gt;= 0. cee_wks gc.cpp 21707  <\/p>\n<pre><code class=\"cpp\">void gc_heap::make_free_list_in_brick (BYTE* tree,                                        make_free_args* args) {   assert ((tree &gt;= 0));   .... }<\/code><\/pre>\n<p>  \u0412\u043e\u0442 \u0442\u0430\u043a\u0430\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f. \u0415\u0449\u0451 \u043f\u0440\u0438\u043c\u0435\u0440\u044b:<\/p>\n<ul>\n<li>V503 This is a nonsensical comparison: pointer &gt;= 0. cee_wks gc.cpp 23204<\/li>\n<li>V503 This is a nonsensical comparison: pointer &gt;= 0. cee_wks gc.cpp 27683<\/li>\n<\/ul>\n<p>  <a href=\"http:\/\/www.viva64.com\/ru\/d\/0137\/\">V547<\/a> Expression &#8216;maxCpuId &gt;= 0&#8217; is always true. Unsigned type value is always &gt;= 0. cee_wks codeman.cpp 1219  <\/p>\n<pre><code class=\"cpp\">void EEJitManager::SetCpuInfo() {   ....   unsigned char buffer[16];   DWORD maxCpuId = getcpuid(0, buffer);   if (maxCpuId &gt;= 0)   {   .... }<\/code><\/pre>\n<p>  \u041f\u043e\u0445\u043e\u0436\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440, \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u0442\u0438\u043f\u043e\u043c DWORD.<\/p>\n<p>  <a href=\"http:\/\/www.viva64.com\/ru\/d\/0194\/\">V590<\/a> Consider inspecting the &#8216;wzPath[0] != L&#8217;\\0&#8217; &amp;&amp; wzPath[0] == L&#8217;\\\\&#187; expression. The expression is excessive or contains a misprint. cee_wks path.h 62  <\/p>\n<pre><code class=\"cpp\">static inline bool HasUncPrefix(LPCWSTR wzPath) {   _ASSERTE(!clr::str::IsNullOrEmpty(wzPath));   return wzPath[0] != W('\\0') &amp;&amp; wzPath[0] == W('\\\\')       &amp;&amp; wzPath[1] != W('\\0') &amp;&amp; wzPath[1] == W('\\\\')       &amp;&amp; wzPath[2] != W('\\0') &amp;&amp; wzPath[2] != W('?'); }<\/code><\/pre>\n<p>  \u042d\u0442\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043c\u043e\u0436\u043d\u043e \u0443\u043f\u0440\u043e\u0441\u0438\u0442\u044c \u0434\u043e \u0442\u0430\u043a\u043e\u0433\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430:  <\/p>\n<pre><code class=\"cpp\">static inline bool HasUncPrefix(LPCWSTR wzPath) {   _ASSERTE(!clr::str::IsNullOrEmpty(wzPath));   return wzPath[0] == W('\\\\')       &amp;&amp; wzPath[1] == W('\\\\')       &amp;&amp; wzPath[2] != W('\\0')       &amp;&amp; wzPath[2] != W('?'); }<\/code><\/pre>\n<p>  \u0415\u0449\u0451 \u0442\u0430\u043a\u043e\u0435 \u043c\u0435\u0441\u0442\u043e:<\/p>\n<ul>\n<li>V590 Consider inspecting this expression. The expression is excessive or contains a misprint. cee_wks path.h 72<\/li>\n<\/ul>\n<p>  <a href=\"http:\/\/www.viva64.com\/ru\/d\/0169\/\">V571<\/a> Recurring check. The &#8216;if (moduleInfo[MSCORWKS].baseAddr == 0)&#8217; condition was already verified in line 749. sos util.cpp 751  <\/p>\n<pre><code class=\"cpp\">struct ModuleInfo {     ULONG64 baseAddr;     ULONG64 size;     BOOL hasPdb; };  HRESULT CheckEEDll() {   ....   \/\/ Do we have clr.dll     if (moduleInfo[MSCORWKS].baseAddr == 0)          \/\/&lt;==     {         if (moduleInfo[MSCORWKS].baseAddr == 0)      \/\/&lt;==             g_ExtSymbols-&gt;GetModuleByModuleName (                MAIN_CLR_MODULE_NAME_A,0,NULL,                &amp;moduleInfo[MSCORWKS].baseAddr);         if (moduleInfo[MSCORWKS].baseAddr != 0 &amp;&amp;    \/\/&lt;==             moduleInfo[MSCORWKS].hasPdb == FALSE)         {           ....         }         ....     }   .... }<\/code><\/pre>\n<p>  \u0412\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 &#8216;baseAddr&#8217; \u0443\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u043d\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c.<\/p>\n<p>  <a href=\"http:\/\/www.viva64.com\/ru\/d\/0343\/\">V704<\/a> &#8216;this == nullptr&#8217; expression should be avoided \u2014 this expression is always false on newer compilers, because &#8216;this&#8217; pointer can never be NULL. ClrJit gentree.cpp 12731  <\/p>\n<pre><code class=\"cpp\">bool FieldSeqNode::IsFirstElemFieldSeq() {     if (this == nullptr)         return false;     return m_fieldHnd == FieldSeqStore::FirstElemPseudoField; }<\/code><\/pre>\n<p>  \u0421\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0443 \u0421++, \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c this \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0443\u043b\u0435\u0432\u044b\u043c. \u041e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u043f\u043e\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u044f\u0445 \u0442\u0430\u043a\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0438 <a href=\"http:\/\/www.viva64.com\/ru\/d\/0343\/\">V704<\/a>. \u0422\u043e, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0434 \u043c\u043e\u0436\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u043f\u043e\u0441\u043b\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043e\u043c Visual C++, \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u0435\u0437\u0435\u043d\u0438\u0435 \u0438 \u043f\u043e\u043b\u0430\u0433\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043d\u0435\u0433\u043e \u043f\u043e-\u0447\u0435\u0441\u0442\u043d\u043e\u043c\u0443 \u043d\u0435\u043b\u044c\u0437\u044f.<\/p>\n<p>  \u0412\u0435\u0441\u044c \u0441\u043f\u0438\u0441\u043e\u043a: <a href=\"http:\/\/www.viva64.com\/external-pictures\/txt\/CoreCLR_V704.txt\">CoreCLR_V704.txt<\/a>.<\/p>\n<p>  <a href=\"http:\/\/www.viva64.com\/ru\/d\/0293\/\">V668<\/a> There is no sense in testing the &#8216;newChunk&#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. ClrJit stresslog.h 552  <\/p>\n<pre><code class=\"cpp\">FORCEINLINE BOOL GrowChunkList () {   ....   StressLogChunk * newChunk = new StressLogChunk (....);   if (newChunk == NULL)   {     return FALSE;   }   .... }<\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 &#8216;new&#8217; \u043d\u0435 \u0441\u043c\u043e\u0433 \u0432\u044b\u0434\u0435\u043b\u0438\u0442\u044c \u043f\u0430\u043c\u044f\u0442\u044c, \u0442\u043e \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0443 \u044f\u0437\u044b\u043a\u0430 \u0421\u0438++, \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 std::bad_alloc(). \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432\u043e \u043d\u0443\u043b\u044e \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0441\u043c\u044b\u0441\u043b\u0430.<\/p>\n<p>  \u041b\u0443\u0447\u0448\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u043c\u0435\u0441\u0442\u0430, \u0432\u043e\u0442 \u043f\u043e\u043b\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a: <a href=\"http:\/\/www.viva64.com\/external-pictures\/txt\/CoreCLR_V668.txt\">CoreCLR_V668.txt<\/a>.<\/p>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>  \u041d\u0435\u0434\u0430\u0432\u043d\u043e \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 CoreCLR \u0445\u043e\u0440\u043e\u0448\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0441\u043e\u0444\u0442 \u0441 \u0437\u0430\u043a\u0440\u044b\u0442\u044b\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c. \u041d\u0430 \u044d\u0442\u0443 \u0442\u0435\u043c\u0443 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u0432\u0435\u0434\u0443\u0442\u0441\u044f \u0434\u0438\u0441\u043a\u0443\u0441\u0441\u0438\u0438 \u0438 \u0432\u043e\u0442 \u0432\u0430\u043c \u0435\u0449\u0451 \u043e\u0434\u0438\u043d \u043f\u043e\u0432\u043e\u0434 \u0434\u043b\u044f \u0440\u0430\u0437\u043c\u044b\u0448\u043b\u0435\u043d\u0438\u0439 \u0438 \u043e\u0431\u0441\u0443\u0436\u0434\u0435\u043d\u0438\u0439.<\/p>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0441 \u0436\u0435 \u0432\u0430\u0436\u043d\u043e, \u0447\u0442\u043e \u0432 \u043b\u044e\u0431\u043e\u043c \u0431\u043e\u043b\u044c\u0448\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u043e\u0448\u0438\u0431\u043a\u0438 \u0438 \u0441\u0430\u043c\u043e\u0435 \u043b\u0443\u0447\u0448\u0435\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u043c\u0443 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0443 \u2013 \u044d\u0442\u043e \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438. \u041d\u0435 \u043b\u0435\u043d\u0438\u0442\u0435\u0441\u044c, <a href=\"http:\/\/www.viva64.com\/ru\/pvs-studio-download\/\">\u0441\u043a\u0430\u0447\u0430\u0439\u0442\u0435<\/a> PVS-Studio \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435 \u0441\u0432\u043e\u0439 \u043f\u0440\u043e\u0435\u043a\u0442.<\/p>\n<h2>\u042d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u043d\u0430 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u043e\u043c<\/h2>\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: Svyatoslav Razmyslov. <a href=\"http:\/\/www.viva64.com\/en\/b\/0310\/\">PVS-Studio: 25 Suspicious Code Fragments in CoreCLR<\/a>.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u0440\u043e\u0447\u0438\u0442\u0430\u043b\u0438 \u0441\u0442\u0430\u0442\u044c\u044e \u0438 \u0435\u0441\u0442\u044c \u0432\u043e\u043f\u0440\u043e\u0441?<\/b><\/p>\n<div class=\"spoiler_text\">\u0427\u0430\u0441\u0442\u043e \u043a \u043d\u0430\u0448\u0438\u043c \u0441\u0442\u0430\u0442\u044c\u044f\u043c \u0437\u0430\u0434\u0430\u044e\u0442 \u043e\u0434\u043d\u0438 \u0438 \u0442\u0435 \u0436\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u044b. \u041e\u0442\u0432\u0435\u0442\u044b \u043d\u0430 \u043d\u0438\u0445 \u043c\u044b \u0441\u043e\u0431\u0440\u0430\u043b\u0438 \u0437\u0434\u0435\u0441\u044c: <a href=\"http:\/\/www.viva64.com\/ru\/a\/0085\/\">\u041e\u0442\u0432\u0435\u0442\u044b \u043d\u0430 \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u0435\u0439 \u0441\u0442\u0430\u0442\u0435\u0439 \u043f\u0440\u043e PVS-Studio \u0438 CppCat, \u0432\u0435\u0440\u0441\u0438\u044f 2014<\/a>. \u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u044c\u0442\u0435\u0441\u044c \u0441\u043e \u0441\u043f\u0438\u0441\u043a\u043e\u043c.  <\/div>\n<\/div>\n<div class=\"clear\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/253280\/\"> http:\/\/habrahabr.ru\/post\/253280\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/62c\/589\/846\/62c589846b53c11218ca6ac02056d42d.png\" \/><\/div>\n<p>  \u041a\u043e\u0440\u043f\u043e\u0440\u0430\u0446\u0438\u044f Microsoft \u0432\u044b\u043b\u043e\u0436\u0438\u043b\u0430 \u0432 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 \u0434\u043e\u0441\u0442\u0443\u043f \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0434\u0432\u0438\u0436\u043a\u0430 CoreCLR, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u043c .NET Core. \u042d\u0442\u0430 \u043d\u043e\u0432\u043e\u0441\u0442\u044c, \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435, \u043d\u0435 \u043c\u043e\u0433\u043b\u0430 \u043d\u0435 \u043f\u0440\u0438\u0432\u043b\u0435\u0447\u044c \u043d\u0430\u0448\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435. \u0412\u0435\u0434\u044c \u0447\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u0430\u0443\u0434\u0438\u0442\u043e\u0440\u0438\u044f \u0443 \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u0442\u0435\u043c \u0442\u0440\u0435\u0432\u043e\u0436\u043d\u0435\u0435 \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0435 \u043f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043c\u0435\u0441\u0442\u0430. \u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0430\u0432\u0442\u043e\u0440\u0441\u0442\u0432\u043e Microsoft, \u043a\u0430\u043a \u0432 \u043b\u044e\u0431\u043e\u043c \u043a\u0440\u0443\u043f\u043d\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435, \u0442\u0443\u0442 \u0435\u0441\u0442\u044c \u043d\u0430 \u0447\u0442\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0438 \u043d\u0430\u0434 \u0447\u0435\u043c \u0437\u0430\u0434\u0443\u043c\u0430\u0442\u044c\u0441\u044f.<\/p>\n<h2>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h2>\n<p>  <a href=\"https:\/\/github.com\/dotnet\/coreclr\">CoreCLR<\/a> \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0440\u0435\u0434\u043e\u0439 \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f .NET Core, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044f \u0442\u0430\u043a\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043a\u0430\u043a \u0441\u0431\u043e\u0440\u043a\u0443 \u043c\u0443\u0441\u043e\u0440\u0430 \u0438\u043b\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u0432 \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0439 \u043c\u0430\u0448\u0438\u043d\u043d\u044b\u0439 \u043a\u043e\u0434. .Net Core \u2014 \u044d\u0442\u043e \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f .Net, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0430 \u043a\u0430\u043a \u0431\u0430\u0437\u0430 \u0434\u043b\u044f \u043e\u0433\u0440\u043e\u043c\u043d\u043e\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0435\u0432.<\/p>\n<p>  \u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0441 \u043d\u0435\u0434\u0430\u0432\u043d\u0435\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043d\u0430 GitHub \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u043b\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <a href=\"http:\/\/www.viva64.com\/ru\/pvs-studio\/\">PVS-Studio<\/a> 5.23. \u041a\u0430\u043a \u0438 \u044f, \u0436\u0435\u043b\u0430\u044e\u0449\u0438\u0435 \u043c\u043e\u0433\u0443\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043f\u043e\u043b\u043d\u044b\u0439 \u043b\u043e\u0433 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Microsoft Visual Studio Community Edition, \u0432\u044b\u0445\u043e\u0434 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0442\u043e\u0436\u0435 \u0431\u044b\u043b \u043d\u0435\u0434\u0430\u0432\u043d\u0435\u0439 <a href=\"http:\/\/www.viva64.com\/ru\/n\/0102\/\">\u043d\u043e\u0432\u043e\u0441\u0442\u044c\u044e<\/a> \u043e\u0442 Microsoft.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-253218","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/253218","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=253218"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/253218\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=253218"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=253218"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=253218"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}