[Lldb-commits] [PATCH] D47492: DWARFUnit::m_die_array swap()->shrink_to_fit()

Jan Kratochvil via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Jun 5 02:45:29 PDT 2018

jankratochvil added a comment.

In https://reviews.llvm.org/D47492#1122080, @labath wrote:

> It doesn't look like your code verifies that the user hasn't replaced the global `operator new` by defining a custom version. http://en.cppreference.com/w/cpp/memory/new/operator_new:

I asked about it in the code, I see I could find it is permitted:

  // Is permitted a symbol interposition of ::operator new to verify even that?

> if libstdc++ exposed a non-weak alias to its `operator new` and then `shrink_to_fit` did a runtime check like `if(&__standard_operator_new == &::operator new)`.

Yes, that is what I planned to write if the symbol interpoisiton is really permitted.

> That seems like a huge hack.

Yes but possible.



More information about the lldb-commits mailing list