1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-06-10 18:58:03 +02:00

52652: fix obscure bug unsetting the array part of a tied parameter pair

This commit is contained in:
Bart Schaefer 2024-03-02 21:37:25 -08:00
parent 145397b6dc
commit d1ff06f991
2 changed files with 8 additions and 2 deletions

View file

@ -1,5 +1,8 @@
2024-03-02 Bart Schaefer <schaefer@zsh.org> 2024-03-02 Bart Schaefer <schaefer@zsh.org>
* 52652: Src/params.c, Test/D04parameter.ztst: fix obscure bug
unsetting the array part of a tied parameter pair, update test
* JunT.: 52635: Test/runtests.zsh: show file name when crashed * JunT.: 52635: Test/runtests.zsh: show file name when crashed
* 52612: Src/parse.c, Src/subst.c, Src/utils.c: change the %l * 52612: Src/parse.c, Src/subst.c, Src/utils.c: change the %l

View file

@ -3813,12 +3813,15 @@ unsetparam_pm(Param pm, int altflag, int exp)
/* fudge things so removenode isn't called */ /* fudge things so removenode isn't called */
altpm->level = 1; altpm->level = 1;
} }
unsetparam_pm(altpm, 1, exp); unsetparam_pm(altpm, 1, exp); /* This resets pm to empty */
pm->node.flags |= PM_UNSET; /* so we must repeat this */
} }
zsfree(altremove); zsfree(altremove);
if (!(pm->node.flags & PM_SPECIAL)) if (!(pm->node.flags & PM_SPECIAL)) {
pm->gsu.s = &stdscalar_gsu; pm->gsu.s = &stdscalar_gsu;
pm->node.flags &= ~PM_ARRAY;
}
} }
/* /*