From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12309 invoked from network); 10 Mar 2005 17:32:40 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 10 Mar 2005 17:32:40 -0000 Received: (qmail 7646 invoked from network); 10 Mar 2005 17:32:34 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 10 Mar 2005 17:32:34 -0000 Received: (qmail 11036 invoked by alias); 10 Mar 2005 17:32:32 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 20959 Received: (qmail 11022 invoked from network); 10 Mar 2005 17:32:31 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 10 Mar 2005 17:32:31 -0000 Received: (qmail 7443 invoked from network); 10 Mar 2005 17:32:28 -0000 Received: from mailhost1.csr.com (HELO MAILSWEEPER01.csr.com) (81.105.217.43) by a.mx.sunsite.dk with SMTP; 10 Mar 2005 17:32:23 -0000 Received: from exchange03.csr.com (unverified [10.100.137.60]) by MAILSWEEPER01.csr.com (Content Technologies SMTPRS 4.3.12) with ESMTP id for ; Thu, 10 Mar 2005 17:30:51 +0000 Received: from news01.csr.com ([10.103.143.38]) by exchange03.csr.com with Microsoft SMTPSVC(5.0.2195.6713); Thu, 10 Mar 2005 17:33:56 +0000 Received: from news01.csr.com (localhost.localdomain [127.0.0.1]) by news01.csr.com (8.13.1/8.12.11) with ESMTP id j2AHWLDc030943 for ; Thu, 10 Mar 2005 17:32:22 GMT Received: from csr.com (pws@localhost) by news01.csr.com (8.13.1/8.13.1/Submit) with ESMTP id j2AHWLq5030940 for ; Thu, 10 Mar 2005 17:32:21 GMT Message-Id: <200503101732.j2AHWLq5030940@news01.csr.com> X-Authentication-Warning: news01.csr.com: pws owned process doing -bs To: zsh-workers@sunsite.dk Subject: Re: PATCH: Re: Segfault on "zmodload -u zsh/parameter" In-reply-to: <1050310165552.ZM5100@candle.brasslantern.com> References: <1050305181810.ZM1556@candle.brasslantern.com> <1050310165552.ZM5100@candle.brasslantern.com> Date: Thu, 10 Mar 2005 17:32:20 +0000 From: Peter Stephenson X-OriginalArrivalTime: 10 Mar 2005 17:33:56.0653 (UTC) FILETIME=[5634FDD0:01C52597] X-Spam-Checker-Version: SpamAssassin 3.0.2 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, score=-2.5 required=6.0 tests=AWL,BAYES_00 autolearn=ham version=3.0.2 X-Spam-Hits: -2.5 Bart Schaefer wrote: > +/**/ > +nullnullsetfn(UNUSED(Param pm), UNUSED(int exp)) > {} Did you mean something like the following? We can test for unloading zsh/parameter as long as we load it again; it doesn't maintain any internal state. > Should nullnullsetfn be used in other places instead of NULL, too? I suppose it wouldn't hurt, at least. > Why do we have nullstrsetfn and nullintsetfn but nullsethashfn? Presumably it's never been needed. Index: Src/params.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/params.c,v retrieving revision 1.96 diff -u -r1.96 params.c --- Src/params.c 21 Jan 2005 11:15:36 -0000 1.96 +++ Src/params.c 10 Mar 2005 17:27:03 -0000 @@ -147,7 +147,7 @@ { hashgetfn, hashsetfn, stdunsetfn }; /**/ mod_export const struct gsu_hash nullsethash_gsu = -{ hashgetfn, nullsethashfn, NULL }; +{ hashgetfn, nullsethashfn, nullunsetfn }; /* Non standard methods (not exported) */ @@ -2604,6 +2604,11 @@ nullintsetfn(UNUSED(Param pm), UNUSED(zlong x)) {} +/**/ +mod_export void +nullunsetfn(UNUSED(Param pm), UNUSED(int exp)) +{} + /* Function to get value of generic special integer * * parameter. data is pointer to global variable * Index: Src/Modules/parameter.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/Modules/parameter.c,v retrieving revision 1.34 diff -u -r1.34 parameter.c --- Src/Modules/parameter.c 6 Feb 2005 20:36:44 -0000 1.34 +++ Src/Modules/parameter.c 10 Mar 2005 17:27:03 -0000 @@ -1817,7 +1817,7 @@ * in a compile-time initialiser, so we use this instead. */ static const struct gsu_hash pmnullsethash_gsu = -{ hashgetfn, nullsethashfn, NULL }; +{ hashgetfn, nullsethashfn, nullunsetfn }; static const struct gsu_hash pmcommands_gsu = { hashgetfn, setpmcommands, stdunsetfn }; static const struct gsu_hash pmfunctions_gsu = Index: Test/V01zmodload.ztst =================================================================== RCS file: /cvsroot/zsh/zsh/Test/V01zmodload.ztst,v retrieving revision 1.6 diff -u -r1.6 V01zmodload.ztst --- Test/V01zmodload.ztst 28 Sep 2001 14:43:13 -0000 1.6 +++ Test/V01zmodload.ztst 10 Mar 2005 17:27:03 -0000 @@ -151,11 +151,12 @@ zmodload -e example 1:Delete the module alias again -# Don't unload the two modules that are required by the test system! +# Don't unload the main module. +# Do unload zsh/parameter, but reload it as it is needed. mods[(r)zsh/main]=() - mods[(r)zsh/parameter]=() zmodunload $mods + zmodload zsh/parameter 0d:Unload the modules loaded by this test suite %clean -- Peter Stephenson Software Engineer CSR PLC, Churchill House, Cambridge Business Park, Cowley Road Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070 ********************************************************************** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. **********************************************************************