gpt4 book ai didi

c++ - 引用地址如何在 C++ 中变为 NULL?

转载 作者:行者123 更新时间:2023-11-28 03:31:08 24 4
gpt4 key购买 nike

我有一个 coredump,它显示一个引用地址是 NULL....

详情:

(gdb) bt
#0 0xffffe410 in __kernel_vsyscall ()
#1 0x005b6c10 in raise () from /lib/libc.so.6
#2 0x005b8521 in abort () from /lib/libc.so.6
#3 0xf749e641 in Application::fatalSignal () at Application.cc:277
#4 <signal handler called>
#5 SdlProcess::procedureReturn (this=0x0, aSignal=0, aArg1=1, aArg2=0x0)
at /include/c++/4.1.1/bits/stl_list.h:652
#6 0x08112edb in Sdl::authFailurer (aSdlProcess=@0x0, aLabel=0, aSignal=0, arg2=0x0) at /Mgr/SdlAuth.cc:1781
#7 0x00000000 in ?? ()
================
define:
Sdl::authFailurer(SdlProcess& aSdlProcess, int aLabel, int aSignal, int /*arg1*/, void* arg2)

#5 aSdlProcess.procedureReturn(0, 1, 0);

在 STL_list.h:652

 bool empty() const

{ return this->_M_impl._M_node._M_next == &this->_M_impl._M_node; } ---->652
in procedureReturn()
{
...
if (!mProcedureStack.empty())---->here,mProcedureStack is a datamember of SdlProcess
...
{
...}
}

最佳答案

您可以通过取消引用 NULL 指针来获得 NULL 引用。我不确定在这种特殊情况下怎么会发生这种情况,除非 mProcedureStack 是一个引用。

关于c++ - 引用地址如何在 C++ 中变为 NULL?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12594061/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com