我在试着调试一次崩溃。(ACCESS_VIOLATION)
下面是一个反汇编片段。我标记了异常发生的行。它在下面显示的实际C++代码中对应什么指令?
拆卸:
420: for( Uint32 i = 0; i < m_children.size(); ++i){
06A923D3 8B 46 0C mov eax,dword ptr [esi+0Ch]
06A923D6 57 push edi
06A923D7 33 FF xor edi,edi
--> 06A923D9 39 38 cmp dword ptr [eax],edi
06A923DB 76 59 jbe ICategoryNode::iterate+66h (6A92436h)
06A923DD 53 push ebx
06A923DE 55 push ebp
06A923DF 8B 2D 04 60 B0 06 mov ebp,dword ptr [__imp_::AssertionFailure::logAssert (6B06004h)]
06A923E5 33 DB xor ebx,ebx
421: bool keepGoing = CategoryImp::recursiveIterator(handler, *m_children[i]);实际C++代码:
void ICategoryNode::iterate(ICategoryHandler& handler) const {
for(Uint32 i = 0; i < m_children.size(); ++i) {
bool keepGoing = CategoryImp::recursiveIterator(handler, *m_children[i]);
if(!keepGoing)
return;
}
}发布于 2011-09-02 22:18:26
看起来cmp dword ptr [eax],edi对应于< size() check --注意,m_children的size成员的取消引用被内联在小于check中。
很可能,您的this指针无效。您可能在空指针上调用了ICategoryNode::iterate,或者已删除的对象或其他东西(如果eax的值很低,它可能是空指针--但无论如何,检查上面的堆栈帧,您应该能够得到被调用对象的坏地址)。
https://stackoverflow.com/questions/7289718
复制相似问题