diff --git a/Test/A05execution.ztst b/Test/A05execution.ztst index 0804691..35efbc0 100644 --- a/Test/A05execution.ztst +++ b/Test/A05execution.ztst @@ -310,3 +310,17 @@ F:anonymous function, and a descriptor leak when backgrounding a pipeline >17 >19 +# Regression test for workers/40645 + # Bug only occurs with POSIXBUILTINS active. + setopt POSIXBUILTINS + # A dot script is needed to trigger the bug. + printf '%s' ' + # Execution counter. + count=0 + # Exiting from a subshell due to an error triggers the bug. + (set -o nonexistent_@_option) 2>/dev/null + # With the bug, this will be executed twice so "let" returns true (0). + let "(count += 1) > 1" + ' > 40645.t + . ./40645.t +1:program flow corruption with POSIXBUILTINS after subshell error exit