Module Name:    src
Committed By:   kamil
Date:           Thu Nov  2 19:39:33 UTC 2017

Modified Files:
        src/lib/libc/stdlib: atexit.c

Log Message:
Revert previous on demand.

Rationale:

The DSO handle is a required part of the (external) __cxa_atexit interface.
The atexit mapping is an implementation detail and not part of the public
interface. Doing it directly creates UB as it involves casting function
pointers between incompatible types.

  -- Joerg


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/lib/libc/stdlib/atexit.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/stdlib/atexit.c
diff -u src/lib/libc/stdlib/atexit.c:1.30 src/lib/libc/stdlib/atexit.c:1.31
--- src/lib/libc/stdlib/atexit.c:1.30	Thu Nov  2 18:37:14 2017
+++ src/lib/libc/stdlib/atexit.c	Thu Nov  2 19:39:33 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: atexit.c,v 1.30 2017/11/02 18:37:14 kamil Exp $	*/
+/*	$NetBSD: atexit.c,v 1.31 2017/11/02 19:39:33 kamil Exp $	*/
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: atexit.c,v 1.30 2017/11/02 18:37:14 kamil Exp $");
+__RCSID("$NetBSD: atexit.c,v 1.31 2017/11/02 19:39:33 kamil Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "reentrant.h"
@@ -205,7 +205,7 @@ again:
 		if (dso == NULL || dso == ah->ah_dso || ah->ah_atexit == NULL) {
 			if (ah->ah_atexit != NULL) {
 				void *p = atexit_handler_stack;
-				if (ah->ah_dso != NULL || ah->ah_arg != NULL) {
+				if (ah->ah_dso != NULL) {
 					cxa_func = ah->ah_cxa_atexit;
 					ah->ah_cxa_atexit = NULL;
 					(*cxa_func)(ah->ah_arg);

Reply via email to