Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libc/stdlib Revert previous on demand.



details:   https://anonhg.NetBSD.org/src/rev/73ac1e29058e
branches:  trunk
changeset: 827551:73ac1e29058e
user:      kamil <kamil%NetBSD.org@localhost>
date:      Thu Nov 02 19:39:33 2017 +0000

description:
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

diffstat:

 lib/libc/stdlib/atexit.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 045f13af79ec -r 73ac1e29058e lib/libc/stdlib/atexit.c
--- a/lib/libc/stdlib/atexit.c  Thu Nov 02 18:37:14 2017 +0000
+++ b/lib/libc/stdlib/atexit.c  Thu Nov 02 19:39:33 2017 +0000
@@ -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 @@
                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);



Home | Main Index | Thread Index | Old Index