mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 19:23:23 +01:00
Don't register the destructors if the list is empty
llvm-svn: 6909
This commit is contained in:
parent
ff614a8a0c
commit
d99475d41a
@ -34,6 +34,10 @@ void __main(void) {
|
||||
/* Loop over all of the constructor records, calling each function pointer. */
|
||||
TorRec *R = __llvm_getGlobalCtors();
|
||||
|
||||
/* Only register the global dtor handler if there is at least one global
|
||||
* dtor!
|
||||
*/
|
||||
if (__llvm_getGlobalDtors()[0].FP)
|
||||
if (atexit(run_destructors))
|
||||
abort(); /* Should be able to install ONE atexit handler! */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user