File tree 2 files changed +14
-0
lines changed
2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -327,6 +327,12 @@ var Aff = function () {
327
327
}
328
328
runTick ++ ;
329
329
Scheduler . enqueue ( function ( ) {
330
+ // It's possible to interrupt the fiber between enqueuing and
331
+ // resuming, so we need to check that the runTick is still
332
+ // valid.
333
+ if ( runTick !== localRunTick + 1 ) {
334
+ return ;
335
+ }
330
336
status = STEP_RESULT ;
331
337
step = result ;
332
338
run ( runTick ) ;
Original file line number Diff line number Diff line change @@ -660,6 +660,13 @@ test_regression_bracket_catch_cleanup = assert "regression/bracket-catch-cleanup
660
660
(\_ → throwError (error " Nope." ))
661
661
pure $ lmap message res == Left " Nope."
662
662
663
+ test_regression_kill_sync_async ∷ Aff Unit
664
+ test_regression_kill_sync_async = assert " regression/kill-sync-async" do
665
+ ref ← newRef " "
666
+ f1 ← forkAff $ makeAff \k -> k (Left (error " Boom." )) *> mempty
667
+ killFiber (error " Nope." ) f1
668
+ pure true
669
+
663
670
main ∷ Effect Unit
664
671
main = do
665
672
test_pure
@@ -707,3 +714,4 @@ main = do
707
714
test_regression_return_fork
708
715
test_regression_par_apply_async_canceler
709
716
test_regression_bracket_catch_cleanup
717
+ test_regression_kill_sync_async
You can’t perform that action at this time.
0 commit comments