zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: zsh-workers@zsh.org
Subject: Re: Segfault in =( ) substitution
Date: Mon, 15 Oct 2012 10:07:21 +0100	[thread overview]
Message-ID: <CAECNH1THarUQspV5r0CkjrEjxUHm7Jp7_J3VG1Q8ph=L3FZmxQ@mail.gmail.com> (raw)
In-Reply-To: <CACeGjnUhwg+ehAX0CAge+Hye3m7xE6vA-5XCwenf4tTXS7kMtg@mail.gmail.com>

On 15 October 2012 04:30, Vin Shelton <acs@alumni.princeton.edu> wrote:
> Starting very recently, I'm getting a core dump from this code:
>
> [[ -n $pat1 ]] && diff1=( =(perl -p -e $pat1 < $file1) )

What's happened here is that =(...) failed because there was no longer
an associated job for it to attach itself to within the variable
assignment.  This is exacerbated by the fact that error handling
in getoutputfile() is poor.

The change in behaviour comes from my patch to invalidate thisjob
within execsimple().  I still think that's correct: the "thisjob" the
expansion was (previously) assigning itself too would be whatever
thisjob happened to be left set to after the last command ran, which
isn't the right thing to do (except by coincidence).

The right thing to do would be to ensure that assignments that have
complex substitutions in aren't marked as "simple".  Failing that,
marking array substitutions as not simple might be good enough.

Now I have to understand parse.c...

pws


  reply	other threads:[~2012-10-15  9:07 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-15  3:30 Vin Shelton
2012-10-15  9:07 ` Peter Stephenson [this message]
2012-10-17 19:20 ` Peter Stephenson
2012-10-17 20:16   ` Peter Stephenson
2012-10-18 15:07     ` Bart Schaefer
2012-10-18 15:27       ` Peter Stephenson
2012-12-21  7:57     ` Han Pingtian
2012-12-21  9:01       ` Han Pingtian
2012-12-21  9:51         ` Han Pingtian
2012-12-21 10:34       ` 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='CAECNH1THarUQspV5r0CkjrEjxUHm7Jp7_J3VG1Q8ph=L3FZmxQ@mail.gmail.com' \
    --to=p.w.stephenson@ntlworld.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).