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

Re: Segfault in =( ) substitution



On Fri, Dec 21, 2012 at 03:57:51PM +0800, Han Pingtian wrote:
> On Wed, Oct 17, 2012 at 09:16:03PM +0100, Peter Stephenson wrote:
> > I suppose it's worth pointing out you can now do things like this...
> > 
> > () {
> >    print File $1:
> >    cat $1
> > } =(print This be the verse)
> > 
> > producing:
> > 
> > File /tmp/zsh0wPl3Y:
> > This be the verse
> > 
> > That's a better bet than any hack within the shell that I can think of
> > because the scoping is obvious.
> > 
> 
> Hello,
> 
> I just noticed that this example crashed on zsh both 5.0 and 5.0.1. If I
> compile zsh with debug enabled, it runs like this:
> 
> % () {
> function> print File $1:
> function> cat $1
> function> } =(print hello)
> File :
> cat: : No such file or directory
> 
> Please take a look. Thanks.

Looks like if revert the below commit this example will work again:

commit ad92cb3203e5d95be91019633e8f1f5835b12794
Author: Peter Stephenson <pws@xxxxxxxxxxxxxxxxxxxxx>
Date:   Thu Oct 11 16:36:14 2012 +0000

    30724: shell code optimisd to use execsimple() doesn't have a valid
    thisjob

    diff --git a/ChangeLog b/ChangeLog
    index 9768aa8..5a69f01 100644
    --- a/ChangeLog
    +++ b/ChangeLog
    @@ -1,3 +1,8 @@
    +2012-10-11  Peter Stephenson  <pws@xxxxxxx>
    +
    +       * 30724: Src/exec.c, Src/jobs.c: shell code optimised to use
    +       execsimple() doesn't have a valid thisjob.
    +
     2012-10-09  Peter Stephenson  <pws@xxxxxxx>

... ...



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