Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: One possible answer to typeset vs. unset
- X-seq: zsh-workers 47724
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: One possible answer to typeset vs. unset
- Date: Fri, 4 Dec 2020 16:22:12 -0800
- Archived-at: <https://zsh.org/workers/47724>
- Archived-at: <http://www.zsh.org/sympa/arcsearch_id/zsh-workers/2020-12/CAH%2Bw%3D7ZVbUFVigzqmntzG2CwOP2v5rZ6v5WhFosOnMUHEy_v1g%40mail.gmail.com>
- Authentication-results: zsh.org; iprev=pass (mail-oi1-f171.google.com) smtp.remote-ip=209.85.167.171; dkim=pass header.d=brasslantern-com.20150623.gappssmtp.com header.s=20150623 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=5V5wxJYAi0LOEzc5ikWWI1L4NaH7C9nMDMdNPHLBx1k=; b=PwrxjnPRTYOPjOQTiMC/wVqDMw7fw8rAdzjQCyF9r37H4Cf3GUsK4brjhAxo60zQof sUm4HARy6ht/vY2dKMzqFNMqLOZhcVKHAeAziMomFVpFdfZ4Gr5jiiZtWOdswn5Hs5e3 +mTkjc3C8CzmtaidTMriFxkNqBMZvPb+6gYAMrit2Npefbrq+rzs+bsZDT3FEtPRXVLH RbDy/6bXJLC7A6P4V7dratyfMRvQI87W5MePoHkXRHevj8XngZEpcstOeEEgpdg/6ex5 RAWybxLM0FV5oEFIPxicS0n/6/xst9lQnoRPbWuhNcydwPlsIAgkidquNJnT9JDzjvix A5+A==
- In-reply-to: <CAH+w=7Yv3ntH=0SxkBYz=KLKKsmvEXL=j_99kSm0jTSJhuySUg@mail.gmail.com>
- List-archive: <http://www.zsh.org/sympa/arc/zsh-workers>
- List-help: <mailto:sympa@zsh.org?subject=help>
- List-id: <zsh-workers.zsh.org>
- List-owner: <mailto:zsh-workers-request@zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-subscribe: <mailto:sympa@zsh.org?subject=subscribe%20zsh-workers>
- List-unsubscribe: <mailto:sympa@zsh.org?subject=unsubscribe%20zsh-workers>
- References: <CAH+w=7Zh8URUiLF2n1x-ZrvKO+=JC8wf+n692sRsFTRbkJrzXw@mail.gmail.com> <CAMP44s2gZnM_JAi78gJwB+uX75Sdx0MQPkW7SZ6tUk85xEjvQg@mail.gmail.com> <CAH+w=7a0es6W_Si9YbQzszzYBSuubmocot_8goywaL_Owb=pjw@mail.gmail.com> <CAMP44s3y2zqbG=8Zxqmn5RcwHC-CF2VaiwADhUbj2AokRKndkA@mail.gmail.com> <CAH+w=7YxvpfjxCP9i9fHSfu0TWXpiCqXrmLkiVDDiDjZWLC8xQ@mail.gmail.com> <CAH+w=7Yv3ntH=0SxkBYz=KLKKsmvEXL=j_99kSm0jTSJhuySUg@mail.gmail.com>
- Sender: zsh-workers-request@xxxxxxx
On Fri, Dec 4, 2020 at 11:47 AM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>
> I've just noticed that the D04 test "Unsetting and recreation of tied
> normal parameters" silently crashes the test harness. The fix for
> this is probably closely related to correcting the flags.
Not so closely related after all. Unset of a tied local scalar left
it using tiedarr_gsu, even though the tie data was null.
That seems like an accident waiting to happen; I tested the patch
below on the master branch, and it still passes the full test suite.
I suggest it be applied there (it's already pushed to the declarednull
branch).
diff --git a/Src/params.c b/Src/params.c
index a0d4caf52..1a047d9e0 100644
--- a/Src/params.c
+++ b/Src/params.c
@@ -3659,6 +3659,8 @@ unsetparam_pm(Param pm, int altflag, int exp)
}
zsfree(altremove);
+ if (!(pm->node.flags & PM_SPECIAL))
+ pm->gsu.s = &stdscalar_gsu;
}
/*
Messages sorted by:
Reverse Date,
Date,
Thread,
Author