在X86-64组件中,是C++通过在功能结尾之前调用毁灭函数函数来植入的破坏者?
当功能结束时,堆栈将使用mov rsp,rbp
(well
)取消分配。该堆栈帧中的任何变量或对象现在都不在范围内。
当一个具有攻击器的对象不符合范围时,我希望在功能结语
https”> https:// https:https:// godbolt.org/z/hr7ke6e5q
但是,看上上述拆卸,情况似乎并非如此。在结语之前调用了与destructor相似的功能(_ZN3Food1ev
),但似乎不是destructor(似乎是_ZN3Food2evev
。
When a function ends, the stack is de-allocated using mov rsp, rbp
(leave
). Any variable or object within that stack frame is now out of scope.
When an object with a destructor goes out of scope, I expected the destructor to be called during the function epilogue
https://godbolt.org/z/hr7KE6e5q
However, looking at the above disassembly, that does not seem to be the case. A similar function (_ZN3FooD1Ev
) to the destructor is called before the epilogue, but it doesn't seem to be the destructor (which seems to be _ZN3FooD2Ev
.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论