[llvm-commits] CVS: llvm/test/Libraries/crtend/crtend.c

John Criswell criswell at choi.cs.uiuc.edu
Thu Jun 26 16:39:56 PDT 2003


Changes in directory llvm/test/Libraries/crtend:

crtend.c updated: 1.1 -> 1.1.2.1

---
Log message:

Merged with mainline on Thursday, June 26, 2003.


---
Diffs of the changes:

Index: llvm/test/Libraries/crtend/crtend.c
diff -u llvm/test/Libraries/crtend/crtend.c:1.1 llvm/test/Libraries/crtend/crtend.c:1.1.2.1
--- llvm/test/Libraries/crtend/crtend.c:1.1	Wed May 14 08:09:41 2003
+++ llvm/test/Libraries/crtend/crtend.c	Thu Jun 26 16:35:35 2003
@@ -34,8 +34,12 @@
   /* Loop over all of the constructor records, calling each function pointer. */
   TorRec *R = __llvm_getGlobalCtors();
 
-  if (atexit(run_destructors))
-    abort();  /* Should be able to install ONE atexit handler! */
+  /* 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! */
 
   /* FIXME: This should sort the list by priority! */
   for (; R->FP; ++R)





More information about the llvm-commits mailing list