Commit d4e788d
committed
fix: prevent quadratic complexity in emStrongLDelim regex
Make suffix groups optional to eliminate O(n) backtracking per exec().
Skip entire delimiter run as text when no valid suffix is found to
avoid the O(n^2) amplification loop.1 parent 22f0c55 commit d4e788d
File tree
3 files changed
+16
-4
lines changed- src
- test/specs/redos
3 files changed
+16
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
726 | 726 | | |
727 | 727 | | |
728 | 728 | | |
729 | | - | |
| 729 | + | |
730 | 730 | | |
731 | 731 | | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
732 | 740 | | |
733 | 741 | | |
734 | | - | |
| 742 | + | |
735 | 743 | | |
736 | | - | |
| 744 | + | |
737 | 745 | | |
738 | 746 | | |
739 | 747 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
290 | 290 | | |
291 | 291 | | |
292 | 292 | | |
293 | | - | |
| 293 | + | |
294 | 294 | | |
295 | 295 | | |
296 | 296 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
0 commit comments