diff --git a/runtime/GCCLibraries/crtend/crtend.c b/runtime/GCCLibraries/crtend/crtend.c index 58f1bf5f9ab..baac8a1b95a 100644 --- a/runtime/GCCLibraries/crtend/crtend.c +++ b/runtime/GCCLibraries/crtend/crtend.c @@ -49,8 +49,9 @@ void __main(void) { abort(); /* Should be able to install ONE atexit handler! */ /* FIXME: This should sort the list by priority! */ - for (; R->FP; ++R) - R->FP(); + if (R->FP) + for (; R->FP; ++R) + R->FP(); } static void run_destructors(void) {