Commit 927c25a
buffer: fix end parameter bugs in indexOf/lastIndexOf
- Fix FastIndexOfNumber parameter order mismatch (end_i64 and
is_forward were swapped vs the JS call site and slow path)
- Clamp negative end values to 0 to prevent size_t overflow in
IndexOfString, IndexOfBuffer, and IndexOfNumberImpl
- Clamp empty needle result to search_end
Signed-off-by: Robert Nagy <ronagy@icloud.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 4563cb3 commit 927c25a
2 files changed
+52
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
983 | 983 | | |
984 | 984 | | |
985 | 985 | | |
986 | | - | |
987 | | - | |
| 986 | + | |
| 987 | + | |
988 | 988 | | |
989 | 989 | | |
990 | 990 | | |
| |||
993 | 993 | | |
994 | 994 | | |
995 | 995 | | |
996 | | - | |
997 | | - | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
998 | 1001 | | |
999 | 1002 | | |
1000 | 1003 | | |
| |||
1108 | 1111 | | |
1109 | 1112 | | |
1110 | 1113 | | |
1111 | | - | |
1112 | | - | |
| 1114 | + | |
| 1115 | + | |
1113 | 1116 | | |
1114 | 1117 | | |
1115 | 1118 | | |
| |||
1118 | 1121 | | |
1119 | 1122 | | |
1120 | 1123 | | |
1121 | | - | |
1122 | | - | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
1123 | 1129 | | |
1124 | 1130 | | |
1125 | 1131 | | |
| |||
1184 | 1190 | | |
1185 | 1191 | | |
1186 | 1192 | | |
1187 | | - | |
1188 | | - | |
| 1193 | + | |
| 1194 | + | |
1189 | 1195 | | |
1190 | 1196 | | |
1191 | 1197 | | |
| |||
1222 | 1228 | | |
1223 | 1229 | | |
1224 | 1230 | | |
1225 | | - | |
1226 | 1231 | | |
| 1232 | + | |
1227 | 1233 | | |
1228 | 1234 | | |
1229 | 1235 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
691 | 691 | | |
692 | 692 | | |
693 | 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 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
0 commit comments