mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-14 16:33:28 +00:00
Don't register the destructors if the list is empty
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6909 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
bc601fe3e7
commit
5d243c2fa5
@ -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…
x
Reference in New Issue
Block a user