Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: 5.0.8 regression regarding $() in arithmetic for-loops



On Jul 27,  3:48pm, Christian Neukirchen wrote:
}
} The following three forms are broken in zsh-5.0.8-0-gf0068ed (release)
} and zsh-5.0.8-109-gb6a2f11:
} 
} % for (( $(true) ; ; )) do echo yes; done
} zsh: parse error near `; '
} zsh: parse error near `$(true) ; ; )) do ec...'

Furthermore:

torch% for (( $(true) ; ; )) do echo yes; done
zsh: parse error near `; '
zsh: parse error near `$(true) ; ; )) do ec...'
torch% (( $(echo 1) ))                        
zsh: segmentation fault (core dumped)  Src/zsh

This happens after this example too:

} % for (( ; $(true) ; )) do echo yes; done 
} zsh: parse error
} zsh: parse error near `$(true) ; )) do echo...'

But not after this example:

} % for (( ; ; $(true) )) do echo yes; done 
} zsh: parse error near `true'
} zsh: parse error near `$(true) )) do echo y...'

I suspect we have a wordcode problem similar to the one with "case"
statements that was fixed earlier (although from a different parser
change).

#0  0x080ca7c1 in has_token (s=0x0) at ../../zsh-5.0/Src/utils.c:2030
#1  0x080a7115 in ecstrcode (s=0x0) at ../../zsh-5.0/Src/parse.c:390
#2  0x080a83f5 in par_cmd (cmplx=0xbff140ec, zsh_construct=0)



Messages sorted by: Reverse Date, Date, Thread, Author