Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Parser bugs: "local a=()"
- X-seq: zsh-workers 35776
- From: ryosuke_i_628@xxxxxxxxxxx
- To: "zsh-workers@xxxxxxx" <zsh-workers@xxxxxxx>
- Subject: Parser bugs: "local a=()"
- Date: Sun, 12 Jul 2015 18:13:18 +0900 (JST)
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.jp; s=yj20110701; t=1436692398; bh=99jMWS+fc2Z3emUbq/sIY9+1XHv+wNASuwKGC3LKLrE=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:X-YMail-JAS:Date:From:Reply-To:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=n6jom0G4UcKKi+W+NFC7/5WVG1qDulcl6ji2bxUY+j9Da/X+l+oDFofdBlpwFivoyg28rDolO1VeBGALGW9PYSblXsiiYkScQPPRpXLf/dDc2IZb5jABKciiJ6Z8QTerH/CcrlAv5+It/6TIi2lWvOvoZrO+WShboFrfI6Q2WJk=
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=yj20110701; d=yahoo.co.jp; h=Message-ID:X-YMail-OSG:Received:X-Mailer:X-YMail-JAS:Date:From:Reply-To:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=d2g1nRF6f6XZSG+auRc1Y1Acq+TCQv0XEj/Ag9+dPPuhF/wxSJ24LfR5sCev50ZvlRJ4yUcsxa4DIecEkhfqi+IIro/WKHm/xQgnoYuMqFK5PPxo0QA9A3bquogeuqe02C8t1LOCq7DOp/DYO5odWwFE8s9oT9L2yQfN7B6H5n8=;
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- Reply-to: ryosuke_i_628@xxxxxxxxxxx
--Summary--
Zsh parser recognize "local a=()" as a local function named "a=".
Sometimes that causes segmentation fault.
(in Japanese)
http://qiita.com/mpyw/items/e9e4c3b872b30c7024ee
--Version--
zsh 5.0.8 (x86_64-apple-darwin14.3.0)
--Reproduction--
[funcs.zsh]
func1() {
a=( )
b=false
echo "a in func1 length: ${#a[@]}"
}
func2() {
local a=( )
local b=false
echo "a in func2 length: ${#a[@]}"
}
func3() {
a=()
b=false
echo "a in func3 length: ${#a[@]}"
}
func4() {
local a=()
local b=false
echo "a in func4 length: ${#a[@]}"
}
[Your shell-session]
example@local:~$ zsh
example@local:~$ zsh --version
zsh 5.0.8 (x86_64-apple-darwin14.3.0)
example@local:~$ source funcs.zsh
example@local:~$ func1
a in func1 length: 0
example@local:~$ func2
func2:1: unknown file attribute:
example@local:~$ func3
a in func3 length: 0
example@local:~$ func4
a in func4 length: 0
[1] 35208 segmentation fault zsh
Messages sorted by:
Reverse Date,
Date,
Thread,
Author