Commit dff5eba
Don't blow the stack when traversing deeply nested sequential expressions (#16882)
* Don't blow stack when traversing deep sequentials
* Sequential expressions are more likely than most other expression
kinds to be deeply nested, e.g., in very large list or array
expressions. Since `traverseSynExpr` is not tail-recursive, we must
treat them specially to avoid blowing the stack.
* Update release notes
* Only when actually nested
* Update comments
* Only alloc seq when needed
* Add very big array test for AST traversal
---------
Co-authored-by: Vlad Zarytovskii <vzaritovsky@hotmail.com>1 parent e4e709f commit dff5eba
File tree
5 files changed
+5061
-2
lines changed- docs/release-notes/.FSharp.Compiler.Service
- src/Compiler/Service
- tests/FSharp.Compiler.UnitTests
5 files changed
+5061
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
379 | 379 | | |
380 | 380 | | |
381 | 381 | | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
382 | 407 | | |
383 | 408 | | |
384 | 409 | | |
| |||
680 | 705 | | |
681 | 706 | | |
682 | 707 | | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
683 | 717 | | |
684 | 718 | | |
685 | 719 | | |
686 | 720 | | |
687 | | - | |
688 | 721 | | |
689 | 722 | | |
690 | 723 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
| 78 | + | |
78 | 79 | | |
79 | 80 | | |
80 | 81 | | |
| |||
0 commit comments