Commit 5450756
authored
Fix finalization after failure (#161)
* Fix finalization after failure
It appears to have only worked coincidentally before. When the
interpreter enters into a finalization block, it puts a `Finalized` node
onto the attempt stack with the current `step`. However if there was
a failure, then step would be null. It "worked" before because there was
stale state, and `fail` could be preserved through finalization. This
bug was exposed by using `catchError` within the finalization block,
which resets the failure state to null. Thus when it resumes after
finalization, both `step` and `fail` are null, which is an invalid
state. The solution is to preserve `fail` in addition to `step` in
a `Finalized` node.
* Cleanup potentially stale state1 parent c02ae17 commit 5450756
2 files changed
+15
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
261 | 261 | | |
262 | 262 | | |
263 | 263 | | |
264 | | - | |
| 264 | + | |
265 | 265 | | |
266 | 266 | | |
267 | 267 | | |
268 | 268 | | |
269 | | - | |
270 | 269 | | |
271 | 270 | | |
272 | 271 | | |
| |||
460 | 459 | | |
461 | 460 | | |
462 | 461 | | |
463 | | - | |
| 462 | + | |
464 | 463 | | |
465 | 464 | | |
466 | 465 | | |
| |||
471 | 470 | | |
472 | 471 | | |
473 | 472 | | |
| 473 | + | |
474 | 474 | | |
475 | 475 | | |
476 | 476 | | |
477 | 477 | | |
478 | | - | |
| 478 | + | |
479 | 479 | | |
480 | 480 | | |
481 | 481 | | |
| |||
484 | 484 | | |
485 | 485 | | |
486 | 486 | | |
| 487 | + | |
487 | 488 | | |
488 | 489 | | |
489 | 490 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
651 | 651 | | |
652 | 652 | | |
653 | 653 | | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
654 | 663 | | |
655 | 664 | | |
656 | 665 | | |
| |||
697 | 706 | | |
698 | 707 | | |
699 | 708 | | |
| 709 | + | |
0 commit comments