mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-26 19:29:16 +00:00
It's a bad idea to have a global event loop in a client application as that will cause an initialization-order fiasco in ASAN. Therefore, LibC now has a flag "s_global_initializers_ran" which is false until _entry in crt0 runs, which in turn only gets called after all the global initializers were actually executed. The EventLoop constructor checks the flag and crashes the program if it is being called as a global constructor. A note next to the VERIFY_NOT_REACHED() informs the developer of these things and how we usually instantiate event loops. The upshot of this is that global event loops will cause a crash before any undefined behavior is hit.
692 B
692 B