Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: SegFault in stringsubst
- X-seq: zsh-workers 32564
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: SegFault in stringsubst
- Date: Fri, 18 Apr 2014 10:02:00 -0700
- In-reply-to: <20140418160344.GA10455@ewok>
- 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
- References: <20140416044612.GB24565@ewok>	<140417114252.ZM22145@torch.brasslantern.com>	<20140418160344.GA10455@ewok>
On Apr 19,  2:03am, Andrew Waldron wrote:
}
} Seems like a similar check should be made for anonymous function
} arguments so that lastval will be set?
This is beginning to have knock-on effects that concern me.  E.g.:
* I don't know whether the lastval ternary test is the right thing, or
  if an unconditional return of 1 is appropriate (should lastval be
  checked in the code I already committed?);
* if we're testing errflag here, we should also do it when evaluating
  "for" and "select" loops (loop.c), which is pushing a new failure
  mode pretty far afield from the original bug;
* which means I'd be a lot happier if we were detecting this as a
  syntax error instead of a run-time error, but that may be pretty
  difficult to do.
 
} diff --git a/Src/exec.c b/Src/exec.c
} index f16cfd3..36b7efa 100644
} --- a/Src/exec.c
} +++ b/Src/exec.c
} @@ -4291,8 +4291,11 @@ execfuncdef(Estate state, UNUSED(int do_exec))
}  	    end += *state->pc++;
}  	    args = ecgetlist(state, *state->pc++, EC_DUPTOK, &htok);
}  
} -	    if (htok && args)
} +	    if (htok && args) {
}  		execsubst(args);
} +		if (errflag)
} +		    return lastval ? lastval : 1;
} +	    }
}  
}  	    if (!args)
}  		args = newlinklist();
Messages sorted by:
Reverse Date,
Date,
Thread,
Author