zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <pws@csr.com>
To: zsh-workers@sunsite.dk
Subject: Re: PATCH: Re: Segfault on "zmodload -u zsh/parameter"
Date: Thu, 10 Mar 2005 17:32:20 +0000	[thread overview]
Message-ID: <200503101732.j2AHWLq5030940@news01.csr.com> (raw)
In-Reply-To: <1050310165552.ZM5100@candle.brasslantern.com>

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 <pws@csr.com>                  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.

**********************************************************************


  reply	other threads:[~2005-03-10 17:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-05 18:18 Bart Schaefer
2005-03-06  5:09 ` Bart Schaefer
2005-03-10 16:55 ` PATCH: " Bart Schaefer
2005-03-10 17:32   ` Peter Stephenson [this message]
2005-03-10 18:04     ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200503101732.j2AHWLq5030940@news01.csr.com \
    --to=pws@csr.com \
    --cc=zsh-workers@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).