Lasse R.H. Nielsen
e260cc0330
Reset regexp lastIndex before using it again.
...
The way JS RegExps handle anchored matches is to have a separate RegExp
with `|()` added at the end, which means it either matches at that point,
or the `()` matches at that point, and that's visible in the captures
as a non-`null` last capture group.
The same RegExp is used to find the number of captures a RegExp has,
by running it on an empty string, and seeing the length of the capture
array, even if it contains nothing but `null` and `""` values.
The RegExp is as JS global regexp, which is what allows it to start matching
at a specific point, which we use for `startsWith(Pattern, start)`.
Every *normal* use of that RegExp remembers to set the `lastIndex` of the
regexp before using it, but the `regExpCaptureCount` used the "anchored
regexp" directly, and forgot to set the `lastIndex`, and since it had just
been used and failed to match at a position *later* than the current input
string's length, the "unfailable" test on the empty string failed, returning
`null` where no `null` was expected.
So now `regExpCaptureCount` sets `lastIndex` to zero before using the RegExp,
like every use of a shared RegExp should.
Fixes #56834
Bug: https://dartbug/com/56834
Change-Id: Ib649b70db5922c277950d7b7cfd4d157788d11cc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/388002
Commit-Queue: Lasse Nielsen <lrn@google.com >
Reviewed-by: Ömer Ağacan <omersa@google.com >
2024-10-03 14:01:41 +00:00
..
2024-10-03 14:01:41 +00:00
2022-09-07 14:49:17 +00:00
2021-06-24 03:29:38 +00:00
2020-04-16 09:20:21 +00:00
2024-02-14 20:12:05 +00:00
2023-09-11 21:05:38 +00:00
2023-09-11 21:05:38 +00:00
2023-09-11 21:05:38 +00:00
2023-09-11 21:05:38 +00:00
2022-10-10 21:04:18 +00:00
2023-09-11 21:05:38 +00:00
2023-09-11 21:05:38 +00:00
2023-09-11 21:05:38 +00:00
2023-09-11 21:05:38 +00:00
2023-09-11 21:05:38 +00:00
2023-09-11 21:05:38 +00:00
2023-09-11 21:05:38 +00:00
2019-12-02 23:13:10 +00:00
2024-03-16 12:56:21 +00:00
2024-03-16 12:56:21 +00:00
2019-12-02 23:13:10 +00:00
2022-11-04 16:10:39 +00:00
2019-12-02 23:13:10 +00:00
2019-12-02 23:13:10 +00:00
2023-03-09 15:14:32 +00:00
2023-03-09 15:14:32 +00:00
2020-07-27 16:44:15 +00:00
2020-04-30 02:33:53 +00:00
2020-04-30 02:33:53 +00:00
2020-04-30 02:33:53 +00:00
2020-04-30 02:33:53 +00:00
2020-04-30 02:33:53 +00:00
2020-05-01 17:02:23 +00:00
2020-05-01 17:02:23 +00:00
2019-12-02 23:13:10 +00:00
2022-12-19 12:56:47 +00:00
2019-12-02 23:13:10 +00:00
2019-12-02 23:13:10 +00:00
2019-12-02 23:13:10 +00:00
2019-12-02 23:13:10 +00:00
2024-02-08 17:00:59 +00:00
2019-12-02 23:13:10 +00:00
2019-12-02 23:13:10 +00:00
2019-12-02 23:13:10 +00:00
2019-12-02 23:13:10 +00:00
2023-04-20 19:19:01 +00:00
2024-02-08 17:00:59 +00:00
2024-09-09 13:44:04 +00:00
2022-02-22 10:47:41 +00:00
2019-12-02 23:13:10 +00:00
2019-12-02 23:13:10 +00:00
2024-06-07 17:58:32 +00:00
2019-12-02 23:13:10 +00:00
2019-12-02 23:13:10 +00:00
2024-03-19 12:30:56 +00:00
2019-12-02 23:13:10 +00:00
2019-12-02 23:13:10 +00:00
2019-12-02 23:13:10 +00:00
2020-03-24 17:34:25 +00:00
2022-10-20 10:50:25 +00:00
2024-06-07 17:58:32 +00:00
2024-06-07 17:58:32 +00:00
2020-09-26 01:11:54 +00:00
2024-06-07 17:58:32 +00:00
2024-06-07 17:58:32 +00:00
2019-12-02 23:13:10 +00:00
2024-02-08 17:00:59 +00:00
2019-12-02 23:13:10 +00:00
2019-12-02 23:13:10 +00:00
2019-12-02 23:13:10 +00:00
2024-02-08 17:00:59 +00:00
2019-12-02 23:13:10 +00:00
2022-12-08 23:29:14 +00:00
2023-02-08 17:45:40 +00:00
2019-12-02 23:13:10 +00:00
2019-12-02 23:13:10 +00:00
2019-12-02 23:13:10 +00:00
2024-02-08 17:00:59 +00:00
2019-12-02 23:13:10 +00:00
2019-12-02 23:13:10 +00:00
2019-12-02 23:13:10 +00:00
2019-12-02 23:13:10 +00:00
2024-02-08 17:00:59 +00:00
2019-12-02 23:13:10 +00:00
2023-02-08 17:45:40 +00:00
2019-12-02 23:13:10 +00:00
2019-12-02 23:13:10 +00:00
2023-03-30 14:02:38 +00:00
2024-06-06 10:56:12 +00:00
2020-05-05 09:57:23 +00:00
2022-12-19 12:56:47 +00:00
2020-05-05 09:57:23 +00:00
2024-02-27 23:01:06 +00:00
2021-11-10 21:36:13 +00:00
2022-11-08 19:02:35 +00:00
2019-12-02 23:19:10 +00:00
2021-04-14 12:07:18 +00:00
2019-12-02 23:19:10 +00:00
2024-04-19 11:35:27 +00:00
2019-12-02 23:19:10 +00:00
2019-12-02 23:19:10 +00:00
2019-12-02 23:19:10 +00:00
2020-03-17 13:43:17 +00:00
2020-03-27 19:02:52 +00:00
2020-04-07 20:09:26 +00:00
2019-12-02 23:19:10 +00:00
2019-12-02 23:19:10 +00:00
2019-12-02 23:19:10 +00:00
2024-02-08 17:00:59 +00:00
2019-12-02 23:19:10 +00:00
2019-12-02 23:19:10 +00:00
2019-12-02 23:19:10 +00:00
2019-12-02 23:19:10 +00:00
2019-12-02 23:19:10 +00:00
2019-12-02 23:19:10 +00:00
2019-12-02 23:19:10 +00:00
2019-12-02 23:19:10 +00:00
2020-03-17 13:43:17 +00:00
2019-12-02 23:19:10 +00:00
2019-12-02 23:19:10 +00:00
2023-01-25 14:08:27 +00:00
2024-02-14 20:12:05 +00:00
2019-12-02 23:19:10 +00:00
2024-06-20 18:01:57 +00:00
2022-12-12 09:54:54 +00:00
2019-12-02 23:19:10 +00:00
2019-12-02 23:19:10 +00:00
2019-12-02 23:19:10 +00:00
2019-12-02 23:19:10 +00:00
2019-12-02 23:19:10 +00:00
2019-12-02 23:19:10 +00:00
2019-12-02 23:19:10 +00:00
2019-12-02 23:19:10 +00:00
2019-12-02 23:19:10 +00:00
2019-12-02 23:19:10 +00:00
2019-12-02 23:19:10 +00:00
2019-12-02 23:19:10 +00:00
2024-02-08 17:00:59 +00:00
2019-12-02 23:19:10 +00:00
2020-01-03 17:32:29 +00:00
2019-12-02 23:19:10 +00:00
2020-04-06 19:17:54 +00:00
2019-12-02 23:19:10 +00:00
2022-05-24 13:54:23 +00:00
2019-12-02 23:19:10 +00:00
2023-04-04 23:05:54 +00:00
2019-12-02 23:19:10 +00:00
2019-12-02 23:19:10 +00:00
2020-04-06 19:17:54 +00:00
2020-03-24 17:34:25 +00:00
2019-12-02 23:19:10 +00:00
2019-12-02 23:19:10 +00:00
2019-12-02 23:19:10 +00:00
2019-12-02 23:19:10 +00:00
2019-12-02 23:19:10 +00:00
2019-12-02 23:19:10 +00:00
2020-04-06 19:17:54 +00:00
2020-04-01 00:03:46 +00:00
2020-04-01 00:03:46 +00:00
2020-04-01 00:03:46 +00:00
2019-12-02 23:19:10 +00:00
2019-12-02 23:19:10 +00:00
2020-02-03 19:06:17 +00:00
2020-02-03 19:06:17 +00:00
2021-01-28 17:19:35 +00:00
2020-02-03 19:06:17 +00:00
2019-12-02 23:19:10 +00:00
2022-09-07 14:49:17 +00:00
2019-12-02 23:19:10 +00:00
2019-12-02 23:19:10 +00:00
2020-01-09 17:11:46 +00:00
2019-12-10 01:17:24 +00:00
2019-12-10 01:17:24 +00:00
2019-12-10 01:17:24 +00:00
2020-03-30 19:58:08 +00:00
2020-03-30 19:58:08 +00:00
2020-11-05 19:46:35 +00:00
2020-11-05 19:46:35 +00:00
2020-03-30 19:58:08 +00:00
2019-12-10 01:17:24 +00:00
2024-05-08 08:59:01 +00:00
2020-01-09 17:11:46 +00:00
2019-12-10 01:17:24 +00:00
2019-12-10 01:17:24 +00:00
2020-03-30 19:58:08 +00:00
2020-03-30 19:58:08 +00:00
2019-12-10 01:17:24 +00:00
2020-03-30 19:58:08 +00:00
2020-03-30 19:58:08 +00:00
2020-03-31 18:14:45 +00:00
2020-03-30 19:58:08 +00:00
2020-03-30 19:58:08 +00:00
2019-12-10 01:17:24 +00:00
2019-12-10 01:17:24 +00:00
2019-12-10 01:17:24 +00:00
2020-05-04 08:14:43 +00:00
2019-12-10 01:17:24 +00:00
2024-02-14 20:12:05 +00:00
2020-03-31 18:14:45 +00:00
2020-05-04 08:14:43 +00:00
2024-09-10 09:03:21 +00:00
2024-09-10 09:03:21 +00:00
2019-12-10 01:17:24 +00:00
2019-12-10 01:17:24 +00:00
2020-07-15 00:45:43 +00:00
2020-03-30 19:58:08 +00:00
2019-12-10 01:17:24 +00:00
2019-12-10 01:17:24 +00:00
2020-01-09 17:11:46 +00:00
2019-12-10 01:17:24 +00:00
2022-12-19 12:56:47 +00:00
2019-12-10 01:17:24 +00:00
2019-12-10 01:17:24 +00:00
2019-12-10 01:17:24 +00:00
2020-03-20 17:58:22 +00:00
2019-12-10 01:17:24 +00:00
2019-12-10 01:17:24 +00:00
2019-12-10 01:17:24 +00:00
2019-12-10 01:17:24 +00:00
2019-12-10 01:17:24 +00:00
2019-12-10 01:17:24 +00:00
2019-12-10 01:17:24 +00:00
2020-03-11 23:31:06 +00:00
2019-12-10 01:17:24 +00:00
2020-03-24 08:21:36 +00:00
2023-07-04 11:00:50 +00:00
2019-12-10 01:17:24 +00:00
2022-09-07 14:49:17 +00:00
2023-03-17 16:17:50 +00:00
2019-12-10 01:17:24 +00:00
2019-12-10 01:17:24 +00:00
2019-12-10 01:17:24 +00:00
2019-12-10 01:17:24 +00:00
2023-08-28 20:16:57 +00:00
2019-12-10 01:17:24 +00:00
2019-12-10 01:17:24 +00:00
2019-12-10 01:17:24 +00:00
2022-02-16 01:32:14 +00:00
2024-06-06 10:56:12 +00:00
2020-01-09 17:11:46 +00:00
2019-12-10 01:17:24 +00:00
2023-02-08 17:45:40 +00:00
2019-12-10 01:17:24 +00:00
2023-02-08 17:45:40 +00:00
2022-12-19 12:56:47 +00:00
2024-04-03 15:57:20 +00:00
2022-11-08 19:02:35 +00:00
2019-12-17 23:06:24 +00:00
2019-12-17 23:06:24 +00:00
2020-11-05 14:26:53 +00:00
2019-12-17 23:06:24 +00:00
2019-12-17 23:06:24 +00:00
2019-12-17 23:06:24 +00:00
2019-12-17 23:06:24 +00:00
2019-12-17 23:06:24 +00:00
2019-12-17 23:06:24 +00:00
2021-06-09 02:50:50 +00:00
2019-12-17 23:06:24 +00:00
2019-12-17 23:06:24 +00:00
2019-12-17 23:06:24 +00:00
2019-12-17 23:06:24 +00:00
2020-11-25 12:01:44 +00:00
2020-06-30 17:14:14 +00:00
2021-05-10 14:15:07 +00:00
2024-02-05 22:38:18 +00:00
2024-05-27 11:52:48 +00:00
2019-12-17 23:06:24 +00:00
2019-12-17 23:06:24 +00:00
2019-12-17 23:06:24 +00:00
2019-12-17 23:06:24 +00:00
2019-12-17 23:06:24 +00:00
2020-03-24 08:21:36 +00:00
2019-12-17 23:06:24 +00:00
2019-12-17 23:06:24 +00:00
2019-12-17 23:06:24 +00:00
2020-12-10 11:00:27 +00:00
2019-12-17 23:06:24 +00:00
2024-04-26 15:28:26 +00:00
2022-07-25 12:21:59 +00:00
2020-04-06 19:17:54 +00:00
2019-12-17 23:06:24 +00:00
2019-12-17 23:06:24 +00:00
2019-12-17 23:06:24 +00:00
2021-03-22 13:20:13 +00:00
2022-12-14 13:41:46 +00:00
2020-03-27 15:59:27 +00:00
2019-12-17 23:06:24 +00:00
2019-12-17 23:06:24 +00:00
2023-04-20 19:19:01 +00:00
2020-03-30 19:58:08 +00:00
2019-12-17 23:06:24 +00:00
2022-12-19 12:56:47 +00:00
2019-12-17 23:06:24 +00:00
2019-12-17 23:06:24 +00:00
2019-12-17 23:06:24 +00:00
2021-02-05 23:53:28 +00:00
2020-03-30 19:58:08 +00:00
2019-12-17 23:06:24 +00:00
2023-11-17 13:34:22 +00:00
2020-03-25 17:32:02 +00:00
2022-06-19 17:02:41 +00:00
2019-12-17 23:06:24 +00:00
2019-12-17 23:06:24 +00:00
2022-05-24 09:10:51 +00:00
2022-01-13 20:52:33 +00:00
2022-01-13 20:52:33 +00:00
2019-12-17 23:06:24 +00:00
2023-04-20 19:19:01 +00:00
2022-05-24 09:10:51 +00:00
2020-01-18 02:55:28 +00:00
2019-12-17 23:06:24 +00:00
2024-02-14 20:12:05 +00:00
2023-04-20 19:19:01 +00:00
2019-12-17 23:06:24 +00:00
2022-05-24 09:10:51 +00:00
2019-12-17 23:06:24 +00:00
2019-12-17 23:06:24 +00:00
2024-04-17 14:41:52 +00:00
2019-12-17 23:06:24 +00:00
2019-12-17 23:06:24 +00:00
2019-12-17 23:06:24 +00:00
2021-10-01 00:56:14 +00:00
2020-04-16 09:20:21 +00:00
2021-07-01 18:43:14 +00:00
2021-06-01 15:55:03 +00:00
2021-06-01 15:55:03 +00:00
2021-07-01 18:43:14 +00:00
2019-12-17 23:06:24 +00:00
2019-12-17 23:06:24 +00:00
2019-12-17 23:06:24 +00:00
2021-04-16 07:33:57 +00:00
2019-12-17 23:06:24 +00:00
2019-12-17 23:06:24 +00:00
2019-12-17 23:06:24 +00:00
2022-12-19 12:56:47 +00:00
2023-11-29 17:37:28 +00:00
2022-09-07 14:49:17 +00:00
2022-06-03 18:07:27 +00:00
2019-12-17 23:06:24 +00:00
2024-03-11 14:48:24 +00:00
2019-12-17 23:06:24 +00:00
2024-03-11 14:48:24 +00:00
2019-12-17 23:06:24 +00:00
2019-12-17 23:06:24 +00:00
2019-12-17 23:06:24 +00:00
2019-12-17 23:06:24 +00:00
2019-12-17 23:06:24 +00:00
2023-01-19 16:24:29 +00:00
2021-06-03 22:47:56 +00:00
2024-04-22 18:00:19 +00:00