1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-01-19 11:31:26 +01:00

44296: "typeset Q= {X}" crashed the shell.

This commit is contained in:
Peter Stephenson 2019-05-14 12:10:10 +01:00
parent 95211f87ed
commit 30e356eb1a
3 changed files with 20 additions and 0 deletions

View file

@ -1,3 +1,8 @@
2019-05-14 Peter Stephenson <p.stephenson@samsung.com>
* 44296: Src/parse.c, Test/B02typeset.ztst: "typeset Q= {X}"
crashed the shell.
2019-05-13 Peter Stephenson <p.stephenson@samsung.com>
* 44259: Src/signals.c: Ensure we can set signal to default

View file

@ -1899,6 +1899,14 @@ par_simple(int *cmplx, int nr)
p += nrediradd;
sr += nrediradd;
}
else if (postassigns)
{
/* C.f. normal case below */
postassigns++;
ecadd(WCB_ASSIGN(WC_ASSIGN_SCALAR, WC_ASSIGN_INC, 0));
ecstr(toksave);
ecstr(""); /* TBD can possibly optimise out */
}
else
{
ecstr(toksave);

View file

@ -1101,3 +1101,10 @@
>export zsh_exported_readonly_scalar=1
>readonly zsh_exported_readonly_array=( 2 )
>readonly zsh_exported_readonly_scalar=1
# The second case was buggy as it needs special handling in postassigns
(typeset {X})
(typeset Q= {X})
1:Regression test for {...} parsing in typeset
?(eval):typeset:2: not valid in this context: {X}
?(eval):typeset:3: not valid in this context: {X}