[libcxx-commits] [libcxx] [libc++] Fix UB in <expected> related to "has value" flag (#68552) (PR #68733)
Jan Kokemüller via libcxx-commits
libcxx-commits at lists.llvm.org
Sun Oct 15 08:00:37 PDT 2023
jiixyj wrote:
> As an alternative, I wonder if the current ABI is salvageable by saving/restoring tail padding in all "dangerous" functions (i.e. swap, emplace, assign, etc.) with something like:
>
> [...]
I tried something similar on a separate branch as a POC: https://github.com/jiixyj/llvm-project/commit/86fe89005ba6a3f0d8769b574274cc5192462216#diff-99bc4a85cb97f33ff277458a531ca47376ceba6ea7d84329cabf02857941ed3eR976
All `std::construct_at`/`std::destroy_at` calls are funneled through helper functions that save/restore just the minimum amount of bytes that might be overwritten by the constructor/destructor, including the `__has_value_` flag.
Could that be a way out of this?
https://github.com/llvm/llvm-project/pull/68733
More information about the libcxx-commits
mailing list