在X86-64组件中,是C++通过在功能结尾之前调用毁灭函数函数来植入的破坏者?

发布于 2025-01-31 06:47:18 字数 418 浏览 3 评论 0原文

当功能结束时,堆栈将使用mov rsp,rbpwell)取消分配。该堆栈帧中的任何变量或对象现在都不在范围内。

当一个具有攻击器的对象不符合范围时,我希望在功能结语

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文