File tree Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -83,6 +83,8 @@ PRIM(catch) {
8383EndExceptionHandler
8484
8585EndExceptionHandler
86+
87+ SIGCHK ();
8688} while (retry );
8789RefEnd (lp );
8890RefReturn (result );
Original file line number Diff line number Diff line change @@ -159,6 +159,35 @@ never succeeded
159159}
160160}
161161
162+ test 'signals in exception catchers' {
163+ local (signals = sigint) {
164+ let (
165+ was-blocked = false
166+ thrown = ()
167+ thrown2 = ()
168+ ) {
169+ catch @ {
170+ thrown = $*
171+ } {
172+ catch @ e {
173+ kill -INT $pid
174+ was-blocked = true
175+ } {
176+ throw exception
177+ }
178+ }
179+ catch @ {
180+ thrown2 = $*
181+ } {
182+ catch @ e {kill -INT $pid} {throw exception2}
183+ }
184+ assert $was-blocked signal is blocked during catcher
185+ assert {~ $thrown(1) signal} signal exception during catcher is thrown
186+ assert {~ $thrown2(1) signal} second signal is caught
187+ }
188+ }
189+ }
190+
162191test 'heredocs and herestrings' {
163192let (bigfile = ` { mktemp big - file . XXXXXX } )
164193unwind - protect {
You can’t perform that action at this time.
0 commit comments