Commit 73be8a5
authored
Store start of slice string as bytes, not chars (#1186)
Not all functions access the string's backing memory according to the
string's encoding. js_regexp_match in particular uses str8 for both
ascii and wide strings. Because the offset into the parent string
was stored in characters, js_regexp_match used the wrong offset (off
by 50%) for wide slice strings.
It's conceivable other functions do something similarly ill-advised,
so store the start in bytes instead of characters from now on.
Fixes: #11781 parent 62b4eed commit 73be8a5
1 file changed
+11
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
580 | 580 | | |
581 | 581 | | |
582 | 582 | | |
583 | | - | |
| 583 | + | |
584 | 584 | | |
585 | 585 | | |
586 | | - | |
| 586 | + | |
587 | 587 | | |
588 | 588 | | |
589 | 589 | | |
| |||
592 | 592 | | |
593 | 593 | | |
594 | 594 | | |
595 | | - | |
| 595 | + | |
596 | 596 | | |
597 | 597 | | |
598 | 598 | | |
599 | 599 | | |
600 | 600 | | |
601 | | - | |
| 601 | + | |
602 | 602 | | |
603 | | - | |
| 603 | + | |
| 604 | + | |
604 | 605 | | |
605 | | - | |
606 | | - | |
607 | | - | |
608 | | - | |
609 | | - | |
610 | | - | |
611 | | - | |
612 | | - | |
613 | | - | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
614 | 609 | | |
615 | 610 | | |
616 | 611 | | |
| |||
3750 | 3745 | | |
3751 | 3746 | | |
3752 | 3747 | | |
3753 | | - | |
| 3748 | + | |
3754 | 3749 | | |
3755 | 3750 | | |
3756 | 3751 | | |
| |||
3762 | 3757 | | |
3763 | 3758 | | |
3764 | 3759 | | |
3765 | | - | |
| 3760 | + | |
3766 | 3761 | | |
3767 | 3762 | | |
3768 | 3763 | | |
| |||
0 commit comments