[libc-commits] [libc] [libc][__support] Remove inline_memset(0) from FixedVector::pop_back (PR #214036)

Pavel Labath via libc-commits libc-commits at lists.llvm.org
Thu Aug 6 04:00:13 PDT 2026


labath wrote:

This looks like intentional hardening (reducing the blast radius of use-after-free's), added in #122159.

If we don't want to reverse that, then something like `static_assert<is_trivially_destructible_t<T>)` (or some other trait) would probably be the best option.

That said, I'm actually planning to add proper lifetime handling to this class (I want to store nontrivial objects in some tests), at which point the placement would actually be correct (as an object would be placement new'ed into the place when/if the storage is reused.

https://github.com/llvm/llvm-project/pull/214036


More information about the libc-commits mailing list