{"id":89,"date":"2023-10-06T18:53:13","date_gmt":"2023-10-06T10:53:13","guid":{"rendered":"https:\/\/wp.minicoda.com\/?p=89"},"modified":"2024-10-25T16:58:20","modified_gmt":"2024-10-25T08:58:20","slug":"%e6%9c%aa%e5%88%9d%e5%a7%8b%e5%8c%96%e7%9a%84%e5%8f%98%e9%87%8f","status":"publish","type":"post","link":"https:\/\/wp.minicoda.com\/index.php\/%e6%9c%aa%e5%88%9d%e5%a7%8b%e5%8c%96%e7%9a%84%e5%8f%98%e9%87%8f\/","title":{"rendered":"\u672a\u521d\u59cb\u5316\u7684\u53d8\u91cf"},"content":{"rendered":"\n<p>  \u5b66\u4e60C\u8bed\u8a00\u5c40\u90e8\u53d8\u91cf\uff0c\u7ecf\u5e38\u542c\u5230\u8fd9\u4e2a\u8bf4\u6cd5\u3002\u4e3a\u4ec0\u4e48\u5c40\u90e8\u53d8\u91cf\u9ed8\u8ba4\u662f\u672a\u521d\u59cb\u5316\u7684\uff1f\u89e3\u91ca\u5b83\u9700\u8981\u7406\u89e3\u7a0b\u5e8f\u7ed3\u6784\u548c\u6808\u64cd\u4f5c\u3002<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u6808\u5185\u5b58<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>C\/C++\u51fd\u6570\u7684\u5c40\u90e8\u53d8\u91cf\u4fdd\u5b58\u5728\u6808\uff0c\u6808\u53ef\u4ee5\u8ba4\u4e3a\u662f\u64cd\u4f5c\u7cfb\u7edf\u4e3a\u4e86\u201c\u52a0\u901f\u201d\u7a0b\u5e8f\u8fd0\u884c\u7ed9\u7ebf\u7a0b\u914d\u7f6e\u4e86\u4e00\u5757\u4e34\u65f6\u4f7f\u7528\u7684\u5185\u5b58\u533a\u57df\uff0c\u5982\u679c\u6709\u4e34\u65f6\u4f7f\u7528\u7684\u53d8\u91cf\uff0c\u76f4\u63a5\u538b\u6808\u6216\u8005\u51fa\u6808\u5373\u53ef\u3002<\/li>\n\n\n\n<li>CPU\u7528push\u548cpop\u6267\u884c\u538b\u6808\u548c\u51fa\u6808\uff0c\u4ec5\u4ec5\u662f\u4fee\u6539\u7684RSP\u6216ESP\u7684\u6307\u9488\uff0c\u6ca1\u6709\u4efb\u4f55\u4e00\u6761\u6307\u4ee4\u5728\u6e05\u96f6\u6808\u5185\u5b58\u3002<\/li>\n\n\n\n<li>C\/C++\u5c40\u90e8\u53d8\u91cfint a\u6216\u8005int a[10]\u5e76\u4e0d\u4f1a\u751f\u6210\u521d\u59cb\u5316\u5b83\u4eec\u7684\u4ee3\u7801\uff0c\u7f16\u8bd1\u5668\u53ea\u4e0d\u8fc7\u5077\u5077\u8ba1\u7b97\u5360\u7528\u7684\u7a7a\u95f4\uff0c\u5e76\u4fee\u6539RSP\/ESP\u521d\u59cb\u503c\uff0c\u5e76\u901a\u8fc7\u5b83\u4eec\u7684\u76f8\u5bf9\u5173\u7cfb\u627e\u5230\u5bf9\u5e94\u7684\u4e34\u65f6\u53d8\u91cf\uff0c\u4ec5\u6b64\u800c\u5df2\u3002<\/li>\n\n\n\n<li>\u6ce8\u610f\uff0c\u9700\u8981\u548c\u7533\u8bf7\u5185\u5b58\u6e05\u96f6\u533a\u5206\u5f00\u3002\u8fd9\u662f\u7533\u8bf7\u7684\u65f6\u523b\u6e05\u96f6\uff0c\u8fd0\u884c\u65f6\u64cd\u4f5c\u7cfb\u7edf\u4e0d\u4f1a\u6d6a\u8d39\u65f6\u95f4\u53bb\u6e05\u96f6\u4e0d\u7528\u7684\u5806\u6808\u3002<\/li>\n\n\n\n<li>\u987a\u5e26\u4ecb\u7ecd\u4e00\u4e0b\u5411\u5185\u6838\u7533\u8bf7\u5185\u5b58\u7684\u6e05\u96f6\u884c\u4e3a\u3002\u64cd\u4f5c\u7cfb\u7edf\u5728\u521b\u5efa\u8fdb\u7a0b\u6216\u7ebf\u7a0b\u65f6\uff0cWindows\u65e9\u671f\u5185\u6838\u5e76\u4e0d\u4e3a\u6808(\u5305\u62ec\u5806\u5185\u5b58)\u521d\u59cb\u5316\uff0cWindows 10 \u7248\u672c 2004 \u4e4b\u540e\u5efa\u8bae\u7528\u7c7b\u4f3cExAllocatePoolZero\u7684API\u7533\u8bf7(\u9ed8\u8ba4\u4f1a\u6e05\u96f6\u5185\u5b58)\uff0c\u8bf7\u53c2\u89c1\uff1a<a href=\"https:\/\/learn.microsoft.com\/zh-cn\/windows-hardware\/drivers\/kernel\/updating-deprecated-exallocatepool-calls\">Windows\u5185\u6838\u7533\u8bf7\u5185\u5b58\u6e05\u96f6?<\/a>  \u503c\u5f97\u6ce8\u610f\u7684\u662f\uff0c\u4e00\u822c\u800c\u8a00\uff0c\u901a\u8fc7\u64cd\u4f5c\u7cfb\u7edfnative API\u5411\u5185\u6838\u7533\u8bf7\u7684\u5185\u5b58\uff0c\u4e00\u822c\u4f1a\u88ab\u6e05\u96f6\uff0c\u8fd9\u662f\u4e3a\u4e86\u5b89\u5168(\u6ce8\u610f\u5185\u6838\u4e3a\u4e86\u4f18\u5316\u6027\u80fd\uff0c\u53ef\u80fd\u7528\u4e00\u4e2afake zero page\u4ee3\u66ff(\u8bfb\u5185\u5b58\u53ea\u4f1a\u8fd4\u56de0\uff0c\u672a\u771f\u6b63\u5c06page\u6e05\u96f6)\uff0c\u7b49\u5230\u771f\u6b63\u5199\u5185\u5b58\u65f6\u91cd\u65b0\u7533\u8bf7\u521b\u5efaPTE\u5e76\u505a\u771f\u6b63\u6e05\u96f6\u52a8\u4f5c)\u3002\u4f46\u5185\u6838\u6001\u5c5e\u4e8e\u4fe1\u4efb\u6a21\u5f0f\uff0c\u5185\u6838\u4f7f\u7528\u65b0page\u53ef\u80fd\u4f7f\u7528\u975e\u96f6\u5185\u5b58\u3002<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">\u672a\u521d\u59cb\u5316\u7684\u53d8\u91cf\u662f\u5426\u80fd\u4f7f\u7528?<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>C\/ObjC\/C++\u9ed8\u8ba4\u5141\u8bb8\u4f7f\u7528\u672a\u521d\u59cb\u5316\u7684\u53d8\u91cf\uff0cGCC\/G++\/Clang\/Clang++\u6253\u5f00-Wall\u624d\u4f1a\u63d0\u793awarning\uff1a<br>\u2018<em><strong>xxx<\/strong><\/em>\u2019 is used uninitialized [-Wuninitialized]<br>- MSVC\u4f1a\u66f4\u4e25\u683c\uff0c\u7f16\u8bd1C\/C++\u4ee3\u7801\u9ed8\u8ba4\u5c31\u4f1a\u63d0\u793a\u672a\u521d\u59cb\u5316\u53d8\u91cf\u7684\u8b66\u544a\uff0c\u7f16\u8bd1\u4f9d\u7136\u53ef\u4ee5\u901a\u8fc7\u3002\u5982\u9700\u5c06\u6b64\u6807\u8bb0\u4e3aerror\uff0c\u9700\u8981\u52a0\u53c2\u6570\/we 4700:\n<ul class=\"wp-block-list\">\n<li>cl.exe \/we 4700 <strong><em>xxx<\/em><\/strong>.cpp<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>C#\u4e0d\u5141\u8bb8\u4f7f\u7528\u672a\u521d\u59cb\u5316\u7684\u5c40\u90e8\u53d8\u91cf\uff0c\u4f1a\u7f16\u8bd1\u9519\u8bef\u3002C#\u7684\u7c7b\u6216\u7ed3\u6784\u7684\u5b57\u6bb5\uff0c\u4e0d\u663e\u5f0f\u521d\u59cb\u5316\uff0c\u9ed8\u8ba4\u503c\u4e3a0. <\/li>\n\n\n\n<li>Java\u7c7b\u4f3cC#\uff0c\u6ca1\u6709\u7ed3\u6784\u4f53\uff0c\u57fa\u672c\u7c7b\u578b\u548c\u5bf9\u8c61\u5fc5\u987b\u521d\u59cb\u5316\u624d\u80fd\u4f7f\u7528\u3002<\/li>\n\n\n\n<li>Python\u4f5c\u4e3a\u89e3\u91ca\u8bed\u8a00\uff0c\u53d8\u91cf\u4e00\u5b9a\u9700\u8981\u5148\u8d4b\u503c\u624d\u80fd\u7528\u3002<\/li>\n\n\n\n<li>JS\u53ef\u4ee5\u4f7f\u7528\u672a\u521d\u59cb\u5316\u7684\u53d8\u91cf\uff0c\u9ed8\u8ba4\u503c\u662fundefined. <br>let a<br>console.log(a) \/\/ \u8f93\u51fa: undefined<\/li>\n\n\n\n<li>VB.NET\u6ca1\u521d\u59cb\u5316\u7684\u53d8\u91cf\uff0c\u4f1a\u6709\u9ed8\u8ba4\u503c\uff0c\u6570\u503c\u7c7b\u578b\u9ed8\u8ba4\u503c\u4e3a0.<br>Dim y As Integer<br>Console.WriteLine(y)  \/\/ \u7f16\u8bd1OK\uff0c\u8f93\u51fa\u4e3a\uff1a0<\/li>\n\n\n\n<li>Go\u8bed\u8a00\u672a\u521d\u59cb\u5316\u53d8\u91cf\u4f1a\u88ab\u8d4b\u503c\u4e3a\u9ed8\u8ba4\u503c\uff0c\u4f8b\u5982\uff0c\u6574\u578b\u9ed8\u8ba4\u4e3a0<br>var x int<br>println(x)  \/\/ \u7f16\u8bd1OK\uff0c\u8f93\u51fa\uff1a0<\/li>\n\n\n\n<li>Rust\/Swift\/\u4ed3\u9889 \u4f7f\u7528\u53d8\u91cf\u524d\u5fc5\u987b\u521d\u59cb\u5316\uff0c\u5426\u5219\u4f1a\u7f16\u8bd1\u9519\u8bef\u3002<\/li>\n<\/ul>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u672a\u521d\u59cb\u5316\u7c7b\u578b\u7684\u9ed8\u8ba4\u503c<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>C\/ObjC\/C++ \u672a\u521d\u59cb\u5316\u7c7b\u578b\u9ed8\u8ba4\u503c\u662f\u4e0d\u786e\u5b9a\u7684\u3002<\/li>\n\n\n\n<li>Go \u6574\u578b\u548c\u6d6e\u70b9\u6570\u9ed8\u8ba4\u662f0\uff0c\u5b57\u7b26\u4e32\u9ed8\u8ba4\u662f\u7a7a\u5b57\u7b26\u4e32\"\", \u5e03\u5c14\u7c7b\u578b\u9ed8\u8ba4\u662ffalse.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u5b66\u4e60C\u8bed\u8a00\u5c40\u90e8\u53d8\u91cf\uff0c\u7ecf\u5e38\u542c\u5230\u8fd9\u4e2a\u8bf4\u6cd5\u3002\u4e3a\u4ec0\u4e48\u5c40\u90e8\u53d8\u91cf\u9ed8\u8ba4\u662f\u672a\u521d\u59cb\u5316\u7684\uff1f\u89e3\u91ca\u5b83\u9700\u8981\u7406\u89e3\u7a0b\u5e8f\u7ed3\u6784\u548c\u6808\u64cd\u4f5c\u3002 \u6808\u5185\u5b58 \u672a\u521d\u59cb\u5316\u7684\u53d8\u91cf\u662f\u5426\u80fd\u4f7f\u7528? \u672a\u521d\u59cb\u5316\u7c7b\u578b\u7684\u9ed8\u8ba4\u503c<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[22,8],"tags":[23,9],"class_list":["post-89","post","type-post","status-publish","format-standard","hentry","category-22","category-8","tag-23","tag-9"],"views":185,"_links":{"self":[{"href":"https:\/\/wp.minicoda.com\/index.php\/wp-json\/wp\/v2\/posts\/89","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wp.minicoda.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wp.minicoda.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wp.minicoda.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wp.minicoda.com\/index.php\/wp-json\/wp\/v2\/comments?post=89"}],"version-history":[{"count":9,"href":"https:\/\/wp.minicoda.com\/index.php\/wp-json\/wp\/v2\/posts\/89\/revisions"}],"predecessor-version":[{"id":3122,"href":"https:\/\/wp.minicoda.com\/index.php\/wp-json\/wp\/v2\/posts\/89\/revisions\/3122"}],"wp:attachment":[{"href":"https:\/\/wp.minicoda.com\/index.php\/wp-json\/wp\/v2\/media?parent=89"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wp.minicoda.com\/index.php\/wp-json\/wp\/v2\/categories?post=89"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wp.minicoda.com\/index.php\/wp-json\/wp\/v2\/tags?post=89"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}