zsh-workers
 help / color / mirror / Atom feed
* [PATCH 2/2] Do execute the always block even when the try/always block itself is the last command.
  2020-01-15 18:02 [PATCH 1/2] Add an XFail test: The exec-last-command optimization is applied to try/always Daniel Shahaf
@ 2020-01-15 18:02 ` Daniel Shahaf
  0 siblings, 0 replies; only message in thread
From: Daniel Shahaf @ 2020-01-15 18:02 UTC (permalink / raw)
  To: zsh-workers

Fixes the test added in the previous commit.
---
Is this correct?

I guess it'll have to wait for 5.9, or at least 5.8.1?  (as opposed to 5.8.0)

Cheers,

Daniel


 Src/loop.c           | 2 +-
 Test/A01grammar.ztst | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Src/loop.c b/Src/loop.c
index 538afb8dc..57858a150 100644
--- a/Src/loop.c
+++ b/Src/loop.c
@@ -742,7 +742,7 @@ exectry(Estate state, int do_exec)
 
     /* The :try clause */
     ++try_tryflag;
-    execlist(state, 1, do_exec);
+    execlist(state, 1, 0);
     --try_tryflag;
 
     /* Don't record errflag here, may be reset.  However, */
diff --git a/Test/A01grammar.ztst b/Test/A01grammar.ztst
index 1e0e9a04e..0dbf468f6 100644
--- a/Test/A01grammar.ztst
+++ b/Test/A01grammar.ztst
@@ -930,5 +930,5 @@ F:Note that the behaviour of 'exit' inside try-list inside a function is unspeci
 >or false
 
  $ZTST_testdir/../Src/zsh -fc '{ ( ) } always { echo foo }'
--f:exec last command optimization inhibited for try/always
+0:exec last command optimization inhibited for try/always
 >foo

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-01-15 18:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-15 18:02 [PATCH 1/2] Add an XFail test: The exec-last-command optimization is applied to try/always Daniel Shahaf
2020-01-15 18:02 ` [PATCH 2/2] Do execute the always block even when the try/always block itself is the last command Daniel Shahaf

zsh-workers

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.vuxu.org/zsh-workers

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 zsh-workers zsh-workers/ http://inbox.vuxu.org/zsh-workers \
		zsh-workers@zsh.org
	public-inbox-index zsh-workers

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.zsh.workers


code repositories for the project(s) associated with this inbox:

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

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git