From 87b1f05911e3369897307f81c04b8ed4db240d6e Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Tue, 31 Dec 2019 01:52:32 +0000 Subject: [PATCH 2/2] Add an expected-to-fail test for workers/44007. --- Etc/BUGS | 14 ++------------ Test/C03traps.ztst | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/Etc/BUGS b/Etc/BUGS index 3fbe818..8112299 100644 --- a/Etc/BUGS +++ b/Etc/BUGS @@ -26,16 +26,6 @@ skipped when STTY=... is set for that command 41203 and others: Make it easier to maintain C modules out of tree. (May require defining a stable API for modules, see 41254) ------------------------------------------------------------------------ -44007 - Martijn - exit in trap executes rest of function (prints "fn2") -[[[ -trap 'echo $1; exit; echo $2' USR1 -fn() { - echo fn1 - kill -USR1 $$ - echo fn2 -} -echo out1 -fn trap1 trap2 -echo out2 -]]] +44007 - Martijn - exit in trap executes rest of function +See test case in Test/C03traps.ztst. ------------------------------------------------------------------------ diff --git a/Test/C03traps.ztst b/Test/C03traps.ztst index 4aebd92..8fdd780 100644 --- a/Test/C03traps.ztst +++ b/Test/C03traps.ztst @@ -881,6 +881,21 @@ F:Must be tested with a top-level script rather than source or function $ZTST_testdir/../Src/zsh -f <<<'fn() { exit 0; }; trap fn EXIT; false' 0:Explicit exit status overrides implicit: script-like code path + $ZTST_testdir/../Src/zsh -f <<<$' + trap \'printf $1; exit; printf $2\' USR1 + fn() { + printf fn1 + kill -s USR1 $$ + printf fn2 + } + printf out1 + fn trap1 trap2 + printf out2 + ' +0f:(workers/44007) function execution continues after 'exit' in trap +>out1fn1trap1 +# As of 5.7.1-test-2, the output was "out1fn1trap1fn2". + %clean rm -f TRAPEXIT -- 2.20.1