Commit cb18a94
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 cb18a94
2 files changed
+53
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
984 | 984 | | |
985 | 985 | | |
986 | 986 | | |
987 | | - | |
| 987 | + | |
| 988 | + | |
988 | 989 | | |
989 | 990 | | |
990 | 991 | | |
| |||
993 | 994 | | |
994 | 995 | | |
995 | 996 | | |
996 | | - | |
997 | | - | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
998 | 1002 | | |
999 | 1003 | | |
1000 | 1004 | | |
| |||
1109 | 1113 | | |
1110 | 1114 | | |
1111 | 1115 | | |
1112 | | - | |
| 1116 | + | |
| 1117 | + | |
1113 | 1118 | | |
1114 | 1119 | | |
1115 | 1120 | | |
| |||
1118 | 1123 | | |
1119 | 1124 | | |
1120 | 1125 | | |
1121 | | - | |
1122 | | - | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
1123 | 1131 | | |
1124 | 1132 | | |
1125 | 1133 | | |
| |||
1185 | 1193 | | |
1186 | 1194 | | |
1187 | 1195 | | |
1188 | | - | |
| 1196 | + | |
| 1197 | + | |
1189 | 1198 | | |
1190 | 1199 | | |
1191 | 1200 | | |
| |||
1222 | 1231 | | |
1223 | 1232 | | |
1224 | 1233 | | |
1225 | | - | |
1226 | 1234 | | |
| 1235 | + | |
1227 | 1236 | | |
1228 | 1237 | | |
1229 | 1238 | | |
| |||
| 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 | + | |
| 729 | + | |
0 commit comments