Commit 591ecbd
committed
regex-automata: fix bug in DFA quit behavior
It turns out that the way we were dealing with quit states in the DFA
was not quite right. Basically, if we entered a quit state and a match
had been found, then we were returning the match instead of the error.
But the match might not be the correct leftmost-first match, and so, we
really shouldn't return it. Otherwise a regex like '\B.*' could match
much less than it should.
This was caught by a differential fuzzer developed in #848.1 parent 4ef6ddc commit 591ecbd
File tree
6 files changed
+40
-34
lines changed- regex-automata/src
- dfa
- hybrid
- meta
- testdata
6 files changed
+40
-34
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
562 | 562 | | |
563 | 563 | | |
564 | 564 | | |
565 | | - | |
| 565 | + | |
566 | 566 | | |
567 | 567 | | |
568 | 568 | | |
| |||
572 | 572 | | |
573 | 573 | | |
574 | 574 | | |
575 | | - | |
576 | | - | |
| 575 | + | |
| 576 | + | |
577 | 577 | | |
578 | 578 | | |
579 | 579 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
180 | 180 | | |
181 | 181 | | |
182 | 182 | | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | 183 | | |
187 | 184 | | |
188 | 185 | | |
| |||
307 | 304 | | |
308 | 305 | | |
309 | 306 | | |
310 | | - | |
311 | | - | |
312 | | - | |
313 | 307 | | |
314 | 308 | | |
315 | 309 | | |
| |||
611 | 605 | | |
612 | 606 | | |
613 | 607 | | |
614 | | - | |
615 | | - | |
616 | | - | |
617 | 608 | | |
618 | 609 | | |
619 | 610 | | |
| |||
646 | 637 | | |
647 | 638 | | |
648 | 639 | | |
649 | | - | |
650 | | - | |
651 | | - | |
652 | 640 | | |
653 | 641 | | |
654 | 642 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3226 | 3226 | | |
3227 | 3227 | | |
3228 | 3228 | | |
3229 | | - | |
| 3229 | + | |
3230 | 3230 | | |
3231 | 3231 | | |
3232 | 3232 | | |
| |||
3236 | 3236 | | |
3237 | 3237 | | |
3238 | 3238 | | |
3239 | | - | |
3240 | | - | |
| 3239 | + | |
| 3240 | + | |
3241 | 3241 | | |
3242 | 3242 | | |
3243 | 3243 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
282 | 282 | | |
283 | 283 | | |
284 | 284 | | |
285 | | - | |
286 | | - | |
287 | | - | |
288 | 285 | | |
289 | 286 | | |
290 | 287 | | |
| |||
432 | 429 | | |
433 | 430 | | |
434 | 431 | | |
435 | | - | |
436 | | - | |
437 | | - | |
438 | 432 | | |
439 | 433 | | |
440 | 434 | | |
| |||
730 | 724 | | |
731 | 725 | | |
732 | 726 | | |
733 | | - | |
734 | | - | |
735 | | - | |
736 | 727 | | |
737 | 728 | | |
738 | 729 | | |
| |||
770 | 761 | | |
771 | 762 | | |
772 | 763 | | |
773 | | - | |
774 | | - | |
775 | | - | |
776 | 764 | | |
777 | 765 | | |
778 | 766 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
636 | 636 | | |
637 | 637 | | |
638 | 638 | | |
639 | | - | |
| 639 | + | |
640 | 640 | | |
641 | 641 | | |
642 | 642 | | |
| |||
645 | 645 | | |
646 | 646 | | |
647 | 647 | | |
648 | | - | |
| 648 | + | |
649 | 649 | | |
650 | 650 | | |
651 | 651 | | |
| |||
668 | 668 | | |
669 | 669 | | |
670 | 670 | | |
671 | | - | |
| 671 | + | |
672 | 672 | | |
673 | 673 | | |
674 | 674 | | |
| |||
677 | 677 | | |
678 | 678 | | |
679 | 679 | | |
680 | | - | |
| 680 | + | |
681 | 681 | | |
682 | 682 | | |
683 | 683 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
689 | 689 | | |
690 | 690 | | |
691 | 691 | | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
0 commit comments