<tfoot id='epO2z'></tfoot>

      <legend id='epO2z'><style id='epO2z'><dir id='epO2z'><q id='epO2z'></q></dir></style></legend>
      <i id='epO2z'><tr id='epO2z'><dt id='epO2z'><q id='epO2z'><span id='epO2z'><b id='epO2z'><form id='epO2z'><ins id='epO2z'></ins><ul id='epO2z'></ul><sub id='epO2z'></sub></form><legend id='epO2z'></legend><bdo id='epO2z'><pre id='epO2z'><center id='epO2z'></center></pre></bdo></b><th id='epO2z'></th></span></q></dt></tr></i><div id='epO2z'><tfoot id='epO2z'></tfoot><dl id='epO2z'><fieldset id='epO2z'></fieldset></dl></div>

      <small id='epO2z'></small><noframes id='epO2z'>

      • <bdo id='epO2z'></bdo><ul id='epO2z'></ul>

      1. 如何以指向 0xCCCCCCCC 的指针结束

        How to end up with a pointer to 0xCCCCCCCC(如何以指向 0xCCCCCCCC 的指针结束)
      2. <i id='B3TzD'><tr id='B3TzD'><dt id='B3TzD'><q id='B3TzD'><span id='B3TzD'><b id='B3TzD'><form id='B3TzD'><ins id='B3TzD'></ins><ul id='B3TzD'></ul><sub id='B3TzD'></sub></form><legend id='B3TzD'></legend><bdo id='B3TzD'><pre id='B3TzD'><center id='B3TzD'></center></pre></bdo></b><th id='B3TzD'></th></span></q></dt></tr></i><div id='B3TzD'><tfoot id='B3TzD'></tfoot><dl id='B3TzD'><fieldset id='B3TzD'></fieldset></dl></div>
          <bdo id='B3TzD'></bdo><ul id='B3TzD'></ul>

            • <tfoot id='B3TzD'></tfoot>
                <legend id='B3TzD'><style id='B3TzD'><dir id='B3TzD'><q id='B3TzD'></q></dir></style></legend>

                    <tbody id='B3TzD'></tbody>

                  <small id='B3TzD'></small><noframes id='B3TzD'>

                  本文介绍了如何以指向 0xCCCCCCCC 的指针结束的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在处理的程序有时会在尝试读取地址 0xCCCCCCCC 处的数据时崩溃.Google(和 StackOverflow)是我的朋友,我看到它是未初始化堆栈变量的 MSVC 调试代码.为了了解问题的来源,我尝试重现此行为:问题是我无法做到.

                  The program I'm working on crashes sometimes trying to read data at the address 0xCCCCCCCC. Google (and StackOverflow) being my friends I saw that it's the MSVC debug code for uninitialized stack variable. To understand where the problem can come from, I tried to reproduce this behavior: problem is I haven't been able to do it.

                  问题是:您是否有代码片段显示指针如何结束指向0xCCCCCCCC?

                  Question is: have you a code snippet showing how a pointer can end pointing to 0xCCCCCCCC?

                  谢谢.

                  推荐答案

                  使用 /GZ 编译器开关 或 /RTCs 开关.确保 /Od 开关也用于禁用任何优化.

                  Compile your code with the /GZ compiler switch or /RTCs switch. Make sure that /Od switch is also used to disable any optimizations.

                  s

                  启用堆栈帧运行时错误检查,如下所示:

                  Enables stack frame run-time error checking, as follows:

                  • 局部变量初始化为非零值.这有助于识别在调试模式下运行时未出现的错误.由于发布版本中堆栈变量的编译器优化,与发布版本相比,调试版本中堆栈变量仍然为零的可能性更大.一旦程序使用了其堆栈区域,编译器永远不会将其重置为 0.因此,碰巧使用相同堆栈区域的后续未初始化堆栈变量可以返回先前使用该堆栈内存时留下的值.

                  • Initialization of local variables to a nonzero value. This helps identify bugs that do not appear when running in debug mode. There is a greater chance that stack variables will still be zero in a debug build compared to a release build because of compiler optimizations of stack variables in a release build. Once a program has used an area of its stack, it is never reset to 0 by the compiler. Therefore, subsequent, uninitialized stack variables that happen to use the same stack area can return values left over from the prior use of this stack memory.

                  检测局部变量(例如数组)的溢出和不足./RTCs 在访问由结构中的编译器填充导致的内存时不会检测溢出.通过使用 align (C++)、/Zp(结构成员对齐)或 pack,或者如果您以要求编译器添加填充的方式对结构元素进行排序,则可能会发生填充.

                  Detection of overruns and underruns of local variables such as arrays. /RTCs will not detect overruns when accessing memory that results from compiler padding within a structure. Padding could occur by using align (C++), /Zp (Struct Member Alignment), or pack, or if you order structure elements in such a way as to require the compiler to add padding.

                  堆栈指针验证,检测堆栈指针损坏.调用约定不匹配可能会导致堆栈指针损坏.例如,使用函数指针调用 DLL 中的函数,该函数导出为 __stdcall,但将指向该函数的指针声明为 __cdecl.

                  Stack pointer verification, which detects stack pointer corruption. Stack pointer corruption can be caused by a calling convention mismatch. For example, using a function pointer, you call a function in a DLL that is exported as __stdcall but you declare the pointer to the function as __cdecl.

                  这篇关于如何以指向 0xCCCCCCCC 的指针结束的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  C++ stl unordered_map implementation, reference validity(C++ stl unordered_map 实现,参考有效性)
                  C++: Is it possible to use a reference as the value in a map?(C++:是否可以使用引用作为映射中的值?)
                  Where ampersand quot;amp;quot; can be put when passing argument by reference?(其中符号“amp;通过引用传递参数时可以放置吗?)
                  Why can a non-const reference parameter be bound to a temporary object?(为什么可以将非常量引用参数绑定到临时对象?)
                  What is a dangling reference?(什么是悬空引用?)
                  C++ reference changes when push_back new element to std::vector(当 push_back 新元素到 std::vector 时,C++ 引用发生变化)

                    <legend id='gkRLn'><style id='gkRLn'><dir id='gkRLn'><q id='gkRLn'></q></dir></style></legend>
                        <bdo id='gkRLn'></bdo><ul id='gkRLn'></ul>
                          <tbody id='gkRLn'></tbody>

                          <i id='gkRLn'><tr id='gkRLn'><dt id='gkRLn'><q id='gkRLn'><span id='gkRLn'><b id='gkRLn'><form id='gkRLn'><ins id='gkRLn'></ins><ul id='gkRLn'></ul><sub id='gkRLn'></sub></form><legend id='gkRLn'></legend><bdo id='gkRLn'><pre id='gkRLn'><center id='gkRLn'></center></pre></bdo></b><th id='gkRLn'></th></span></q></dt></tr></i><div id='gkRLn'><tfoot id='gkRLn'></tfoot><dl id='gkRLn'><fieldset id='gkRLn'></fieldset></dl></div>
                        1. <tfoot id='gkRLn'></tfoot>

                            <small id='gkRLn'></small><noframes id='gkRLn'>