jumpnbrownweasel
bf67a3fdc9
#8454 Fix for std.mem.replacementSize adjacent matches bug. ( #8455 )
...
* #8454 Fix for std.mem.replacementSize adjacent matches bug.
When two 'needle' values are adjacent in the 'input' slice, the size is not
counted correctly. The 2nd 'needle' value is not matched because the index is
incremented by one after changing the index to account for the first value.
The impact is the the size returned is incorrect, and could cause UB when this
amount is used to size of the buffer passed to std.mem.replace.
* Apply changes from PR review:
- Add assert checking that the needle is non-empty and doc for this.
- Add minimal test that an empty input works.
- Use testing.expectEqualStrings.
2021-04-25 19:16:24 -04:00
..
2021-04-23 22:39:49 +02:00
2021-03-04 11:56:31 -08:00
2021-04-07 16:26:21 -07:00
2021-02-10 20:06:12 -07:00
2021-04-24 13:35:36 -04:00
2021-04-24 10:25:43 +02:00
2021-03-05 13:11:20 +01:00
2021-04-04 17:04:46 -07:00
2021-03-21 23:07:02 +02:00
2021-01-30 20:15:26 -07:00
2021-04-04 17:04:46 -07:00
2021-04-11 16:26:29 +02:00
2021-04-14 17:53:27 +02:00
2021-02-25 22:20:30 +02:00
2021-03-18 14:05:01 -07:00
2021-02-28 14:03:19 +01:00
2021-04-25 21:15:02 +09:00
2021-03-29 09:22:06 +02:00
2021-04-21 19:02:13 +02:00
2021-04-20 16:19:59 -04:00
2020-12-31 15:45:24 -08:00
2021-02-28 14:03:19 +01:00
2020-12-31 15:45:24 -08:00
2021-01-07 23:48:58 -08:00
2020-12-31 15:45:24 -08:00
2021-04-25 21:15:02 +09:00
2021-04-24 15:37:55 +02:00
2021-03-28 11:02:37 +02:00
2021-01-08 16:54:56 -05:00
2021-02-27 01:21:01 -07:00
2020-12-31 15:45:24 -08:00
2021-03-28 14:32:34 +02:00
2021-03-18 14:05:01 -07:00
2020-12-31 15:45:24 -08:00
2021-02-27 13:11:47 +02:00
2021-04-17 15:17:54 +02:00
2021-02-10 20:06:13 -07:00
2021-03-16 01:10:32 +01:00
2021-01-07 23:48:58 -08:00
2021-02-24 21:29:23 -07:00
2021-01-22 15:46:58 +01:00
2020-12-31 15:45:24 -08:00
2021-04-20 19:57:27 +02:00
2020-12-31 15:45:24 -08:00
2021-04-08 23:17:36 -07:00
2020-12-31 15:45:24 -08:00
2021-04-12 17:18:56 -04:00
2020-12-31 15:45:24 -08:00
2021-03-11 10:09:51 +11:00
2021-03-24 19:11:44 +01:00
2020-12-31 15:45:24 -08:00
2021-02-22 00:22:46 +02:00
2021-03-28 15:44:15 +02:00
2021-03-28 14:32:34 +02:00
2021-04-10 12:49:02 -07:00
2020-12-31 15:45:24 -08:00
2020-12-31 15:45:24 -08:00
2021-02-16 23:20:46 +01:00
2021-04-04 10:16:59 +02:00
2020-12-31 15:45:24 -08:00
2021-01-04 14:03:21 -08:00
2021-02-24 21:29:23 -07:00
2021-04-21 06:49:34 +02:00
2021-04-23 19:19:44 +02:00
2021-04-25 19:16:24 -04:00
2021-04-25 19:12:06 -04:00
2021-03-12 00:17:35 +01:00
2021-02-21 11:56:14 +02:00
2021-02-28 14:03:19 +01:00
2021-04-14 16:40:06 -07:00
2021-01-02 01:10:47 +11:00
2021-02-01 15:27:39 -05:00
2021-01-18 19:02:11 +00:00
2021-04-02 10:52:23 -07:00
2021-02-25 16:41:42 -07:00
2021-03-12 19:31:59 -05:00
2021-01-22 15:46:58 +01:00
2021-01-12 18:13:29 -08:00
2021-01-06 15:53:53 -08:00
2020-12-31 15:45:24 -08:00
2021-04-10 22:47:22 -05:00
2021-04-25 21:15:02 +09:00
2021-04-21 16:31:29 +02:00
2021-04-09 10:04:16 -07:00
2021-04-25 13:21:15 -04:00
2021-04-07 08:33:32 -04:00
2021-04-11 16:26:29 +02:00
2021-01-22 15:46:58 +01:00
2021-04-08 22:47:08 +02:00
2021-04-25 21:15:02 +09:00
2021-04-09 10:15:46 -07:00