[clang] [clang][Fuchsia] Have global dtors use llvm.global_dtors over atexit (PR #115788)

Eli Friedman via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 12 12:48:37 PST 2024


https://github.com/efriedma-quic requested changes to this pull request.

I'm not sure we can just unconditionally call the destructor.  We need to ensure the constructor runs first.  If a constructor throws an exception or calls exit(), not all constructors will run before we start cleaning up.  This works out naturally with atexit... but if you use global_dtors, I think you end up calling the destructor on an uninitialized object.

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


More information about the cfe-commits mailing list