zsh-workers
 help / color / mirror / code / Atom feed
From: Mikael Magnusson <mikachu@gmail.com>
To: Peter Stephenson <p.stephenson@samsung.com>
Cc: zsh workers <zsh-workers@zsh.org>
Subject: More incmdpos stuff Re: Crash Re: Trial for 5.0.7
Date: Fri, 3 Oct 2014 13:47:25 +0200	[thread overview]
Message-ID: <CAHYJk3Q73heVqMyH+2c1_ihT4k+OghoJY+J9e0MJSTEL=AEM+w@mail.gmail.com> (raw)

On 3 October 2014 10:58, Peter Stephenson <p.stephenson@samsung.com> wrote:
> On Thu, 02 Oct 2014 21:58:56 -0700
> Bart Schaefer <schaefer@brasslantern.com> wrote:
>> On Oct 2,  8:33pm, Bart Schaefer wrote:
>> }
>> } git-bisect says this is the bad revision:
>> }
>> } commit 8189e12312ede991827efc6683b7ce8463deb0bf
>> }
>> }     32552 (updated by 32560): fix segfault when using process substitution in
>> } anonymous function argument list
>> }
>> }     Also disallow process substitution in function name position.
>>
>> OK, I've narrowed it down to the parse.c hunks of the patch.  Remove
>> just that change, and the crash on piping to an anonymous function is
>> fixed, but this test fails:
>>
>> ./C04funcdef.ztst: starting.
>> Test ./C04funcdef.ztst failed: bad status 1, expected 0 from:
>>   () (cat $1 $2) <(print process expanded) =(print expanded to file)
>> Error output:
>> (eval):1: process substitution <(print process expanded) cannot be used here
>> Was testing: Process substitution with anonymous functions
>> ./C04funcdef.ztst: test failed.
>>
>> Here's the patch to revert workers/32552 (parse.c).  I haven't figured
>> out why fiddling with *complex here mangles the wordcode, some help is
>> appreciated.  Obviously the above test needs to pass.
>
> (I presume that *is* an anonymous function, I'd forgotten that
> functions could be defined with parentheses for the bodies.  Presumably
> using braces makes no difference, though?)

% () ( echo hi; echo $@ ) ls
hi
ls --color=auto -T 0 -A -v --quoting-style=shell

I thought "aha, pws recently fixed something like this so I can just
look at that commit and fix it", but then I looked at the code.

With shortloops set, you can also do the following;
% () for a; ( echo hi; echo $a ) ls
hi
ls
hi
--color=auto
hi
-T
hi
0
hi
-A
hi
-v
hi
--quoting-style=shell

% () for a ( echo hi; echo $a ) ls
.cvsignore     Completion  META-FAQ      Test            config.h.in
     install-sh
[quadruple file listing elided (why four, you say? i don't know, ls is
aliased to two words, \ls $LS_OPTIONS, the second expands to 6
words.)]

(This is why i don't have shortloops set, every syntax error does
something random instead). The second result of actually running ls
happens even without the anon function, eg just
% for a ( echo hi; echo $a ) ls
does it.

% for a; ( echo hi; echo $a ) ls
zsh: parse error near `ls'

-- 
Mikael Magnusson

        ecadd(0);
        ecadd(0);
        ecadd(0);


             reply	other threads:[~2014-10-03 11:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-03 11:47 Mikael Magnusson [this message]
2014-10-03 12:27 ` Peter Stephenson
2014-10-03 14:50   ` More crash " Bart Schaefer
2014-10-03 15:15     ` Peter Stephenson
2014-10-03 15:33       ` Bart Schaefer
2014-10-03 15:42         ` Peter Stephenson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAHYJk3Q73heVqMyH+2c1_ihT4k+OghoJY+J9e0MJSTEL=AEM+w@mail.gmail.com' \
    --to=mikachu@gmail.com \
    --cc=p.stephenson@samsung.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).