mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-05-20 11:31:28 +02:00
52556: fix crash when changing type of unset referent via named reference
This commit is contained in:
parent
74722b8d4e
commit
8c59638522
2 changed files with 9 additions and 2 deletions
|
@ -1,3 +1,8 @@
|
|||
2024-02-17 Bart Schaefer <schaefer@zsh.org>
|
||||
|
||||
* 52556: Src/builtin.c: fix crash when applying a type change via
|
||||
a named reference when the referent has been declared but unset
|
||||
|
||||
2024-02-16 Mikael Magnusson <mikachu@gmail.com>
|
||||
|
||||
* 52546: Functions/Zle/incarg: incarg: avoid unneeded subshell
|
||||
|
|
|
@ -2031,8 +2031,10 @@ typeset_single(char *cname, char *pname, Param pm, int func,
|
|||
char *subscript;
|
||||
|
||||
if (pm && (pm->node.flags & PM_NAMEREF) && !((off|on) & PM_NAMEREF)) {
|
||||
if (!(off & PM_NAMEREF))
|
||||
pm = (Param)resolve_nameref(pm, NULL);
|
||||
if (!(off & PM_NAMEREF)) {
|
||||
if ((pm = (Param)resolve_nameref(pm, NULL)))
|
||||
pname = pm->node.nam;
|
||||
}
|
||||
if (pm && (pm->node.flags & PM_NAMEREF) &&
|
||||
(on & ~(PM_NAMEREF|PM_LOCAL|PM_READONLY))) {
|
||||
/* Changing type of PM_SPECIAL|PM_AUTOLOAD is a fatal error. *
|
||||
|
|
Loading…
Reference in a new issue