zsh-workers
 help / color / mirror / code / Atom feed
From: Daniel Shahaf <danielsh@apache.org>
To: zsh-workers@zsh.org
Subject: [PATCH 2/2] Do execute the always block even when the try/always block itself is the last command.
Date: Wed, 15 Jan 2020 18:02:33 +0000	[thread overview]
Message-ID: <20200115180233.5721-2-danielsh@apache.org> (raw)
In-Reply-To: <20200115180233.5721-1-danielsh@apache.org>

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

      reply	other threads:[~2020-01-15 18:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]

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=20200115180233.5721-2-danielsh@apache.org \
    --to=danielsh@apache.org \
    --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).