Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions prim-ctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ PRIM(catch) {
EndExceptionHandler

EndExceptionHandler

SIGCHK();
} while (retry);
RefEnd(lp);
RefReturn(result);
Expand Down
29 changes: 29 additions & 0 deletions test/tests/trip.es
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,35 @@ never succeeded
}
}

test 'signals in exception catchers' {
local (signals = sigint) {
let (
was-blocked = false
thrown = ()
thrown2 = ()
) {
catch @ {
thrown = $*
} {
catch @ e {
kill -INT $pid
was-blocked = true
} {
throw exception
}
}
catch @ {
thrown2 = $*
} {
catch @ e {kill -INT $pid} {throw exception2}
}
assert $was-blocked signal is blocked during catcher
assert {~ $thrown(1) signal} signal exception during catcher is thrown
assert {~ $thrown2(1) signal} second signal is caught
}
}
}

test 'heredocs and herestrings' {
let (bigfile = `{mktemp big-file.XXXXXX})
unwind-protect {
Expand Down