A. Jiang
bba4ded3c2
[libc++] Fix constructing bitset from non-null-terminated arrays ( #143691 )
...
Unconditional evaluation of `char_traits<_CharT>::length(__str)` is problematic, because it causes
UB when `__str` points to a non-null-terminated array. We should only call `length` (currently, in
`basic_string_view`'s constructor) when `__n == npos` per [bitset.cons]/8.
Drive-by change: Reduction of conditional compilation, given that
- both `basic_string_view<_CharT>::size_type` and `basic_string<_CharT>::size_type` must be
`size_t`, and thus
- both `basic_string_view<_CharT>::npos` and `basic_string<_CharT>::npos` must be `size_t(-1)`.
For the type sameness in the standard wording, see:
- [string.view.template.general]
- [basic.string.general]
- [allocator.traits.types]/6
- [default.allocator.general]/1
Fixes #143684
2025-06-12 10:53:41 -04:00
..
2025-05-28 12:04:51 -04:00
2025-05-28 12:04:51 -04:00
2025-06-11 14:31:13 +02:00
2025-05-28 12:04:51 -04:00
2025-06-11 08:43:23 +02:00
2025-04-09 23:47:57 +02:00
2025-06-11 14:31:13 +02:00
2025-05-28 12:04:51 -04:00
2025-06-10 12:59:08 +02:00
2025-04-09 23:47:57 +02:00
2025-03-27 11:34:38 +01:00
2025-05-31 08:07:15 +01:00
2025-06-10 05:54:15 +02:00
2025-05-28 12:04:51 -04:00
2025-05-28 12:04:51 -04:00
2025-05-28 12:04:51 -04:00
2025-06-07 08:47:46 +01:00
2025-06-07 08:47:46 +01:00
2025-06-11 14:31:13 +02:00
2025-06-12 14:21:29 +02:00
2025-06-02 13:13:57 -04:00
2025-04-09 23:47:57 +02:00
2025-06-06 08:33:15 +02:00
2025-05-28 12:04:51 -04:00
2025-05-08 16:48:57 -04:00
2025-06-11 14:31:13 +02:00
2025-06-11 12:13:36 -04:00
2025-05-28 12:04:51 -04:00
2025-05-28 12:04:51 -04:00
2025-05-28 12:04:51 -04:00
2025-06-11 14:31:13 +02:00
2025-05-28 12:04:51 -04:00
2025-05-28 12:04:51 -04:00
2025-05-28 12:04:51 -04:00
2025-04-24 10:29:59 +02:00
2025-04-13 08:40:21 -04:00
2025-05-07 10:54:34 -04:00
2025-01-10 15:21:58 -05:00
2025-05-28 12:04:51 -04:00
2025-05-28 12:04:51 -04:00
2025-04-09 23:47:57 +02:00
2025-06-11 14:33:41 +02:00
2025-06-11 14:31:13 +02:00
2025-04-09 23:47:57 +02:00
2025-06-07 08:47:46 +01:00
2025-04-09 23:47:57 +02:00
2025-04-09 23:47:57 +02:00
2024-09-17 11:22:27 -04:00
2025-04-18 20:57:05 -04:00
2025-06-10 05:54:15 +02:00
2024-11-06 10:39:19 +01:00
2025-05-28 12:04:51 -04:00
2025-05-28 12:04:51 -04:00
2025-02-18 12:12:23 +01:00
2025-05-15 09:01:56 +02:00
2025-05-08 16:35:00 -04:00
2025-05-18 12:40:34 +02:00
2025-05-28 12:04:51 -04:00
2025-04-19 07:12:43 -04:00
2025-06-02 13:13:57 -04:00
2025-05-08 16:35:00 -04:00
2025-01-17 14:22:40 -05:00
2025-05-28 12:04:51 -04:00
2025-04-09 15:00:46 +02:00
2025-06-12 10:53:41 -04:00
2024-12-21 13:01:48 +01:00
2025-01-08 11:12:59 -05:00
2024-12-21 13:01:48 +01:00
2024-12-21 13:01:48 +01:00
2024-12-21 13:01:48 +01:00
2024-12-21 13:01:48 +01:00
2025-04-09 15:00:46 +02:00
2025-06-11 08:43:23 +02:00
2024-12-21 13:01:48 +01:00
2025-01-08 11:12:59 -05:00
2024-12-21 13:01:48 +01:00
2024-12-21 13:01:48 +01:00
2025-06-11 14:31:13 +02:00
2025-05-08 16:48:57 -04:00
2025-05-28 12:04:51 -04:00
2025-04-09 15:00:46 +02:00
2025-05-08 16:48:57 -04:00
2024-12-21 13:01:48 +01:00
2025-04-09 15:00:46 +02:00
2025-05-28 12:04:51 -04:00
2025-04-09 15:00:46 +02:00
2024-12-21 13:01:48 +01:00
2024-12-21 13:01:48 +01:00
2025-01-08 11:12:59 -05:00
2024-12-21 13:01:48 +01:00
2025-01-08 11:12:59 -05:00
2024-12-21 13:01:48 +01:00
2024-12-21 13:01:48 +01:00
2024-12-21 13:01:48 +01:00
2024-12-21 13:01:48 +01:00
2024-12-21 13:01:48 +01:00
2025-01-08 11:12:59 -05:00
2024-12-21 13:01:48 +01:00
2024-12-21 13:01:48 +01:00
2024-12-21 13:01:48 +01:00
2025-02-27 17:47:34 +01:00
2024-12-21 13:01:48 +01:00
2025-06-10 05:54:15 +02:00
2024-12-21 13:01:48 +01:00
2024-12-21 13:01:48 +01:00
2025-04-09 15:00:46 +02:00
2025-04-09 15:00:46 +02:00
2024-12-21 13:01:48 +01:00
2025-04-09 15:00:46 +02:00
2025-01-25 18:30:00 +00:00
2025-04-06 10:50:55 +01:00
2024-12-21 13:01:48 +01:00
2025-04-09 15:00:46 +02:00
2025-06-11 12:13:36 -04:00
2025-05-28 12:04:51 -04:00
2025-01-10 14:14:14 -05:00
2025-05-28 12:04:51 -04:00
2025-05-28 12:04:51 -04:00
2024-12-21 13:01:48 +01:00
2024-12-21 13:01:48 +01:00
2025-06-10 14:12:46 -04:00
2025-04-09 23:47:57 +02:00
2024-12-21 13:01:48 +01:00
2025-05-28 12:04:51 -04:00
2025-03-01 12:29:21 +01:00
2025-04-09 15:00:46 +02:00
2025-04-09 23:47:57 +02:00
2025-06-07 08:47:46 +01:00
2025-05-28 12:04:51 -04:00
2025-06-07 08:47:46 +01:00
2024-12-21 13:01:48 +01:00
2025-06-08 21:58:36 +00:00
2025-04-14 17:33:57 -04:00
2025-04-09 15:00:46 +02:00
2025-06-11 14:31:13 +02:00
2025-05-28 12:04:51 -04:00
2024-12-21 13:01:48 +01:00
2025-04-09 15:00:46 +02:00
2025-04-05 13:46:11 +02:00
2025-06-02 13:13:57 -04:00
2024-12-21 13:01:48 +01:00
2025-05-28 12:04:51 -04:00
2025-06-04 19:58:25 +08:00
2024-12-21 13:01:48 +01:00
2025-04-09 15:00:46 +02:00
2025-04-09 23:47:57 +02:00
2025-06-10 14:12:46 -04:00
2025-04-09 23:47:57 +02:00
2025-04-09 15:00:46 +02:00
2025-06-07 08:47:46 +01:00
2025-05-28 12:04:51 -04:00
2025-04-09 15:00:46 +02:00
2025-04-09 23:47:57 +02:00
2025-05-28 12:04:51 -04:00
2025-04-09 23:47:57 +02:00
2025-01-17 14:22:40 -05:00
2024-12-21 13:01:48 +01:00
2024-12-21 13:01:48 +01:00
2025-05-28 12:04:51 -04:00
2024-12-23 07:33:26 -08:00
2024-12-23 07:33:26 -08:00
2025-04-09 15:00:46 +02:00
2025-05-28 12:04:51 -04:00
2025-06-10 05:54:15 +02:00
2025-04-19 07:12:43 -04:00
2024-12-21 13:01:48 +01:00
2025-05-28 12:04:51 -04:00
2025-06-10 14:12:46 -04:00
2025-04-19 07:12:43 -04:00
2024-12-21 13:01:48 +01:00
2024-12-21 13:01:48 +01:00
2025-06-03 10:34:45 +08:00
2025-04-29 08:46:06 +02:00
2025-04-09 23:47:57 +02:00
2025-05-28 12:04:51 -04:00
2024-12-21 13:01:48 +01:00
2025-06-07 08:47:46 +01:00
2025-06-07 08:47:46 +01:00
2025-03-25 18:31:57 +01:00
2025-05-28 12:04:51 -04:00
2025-06-02 13:13:57 -04:00
2025-04-19 07:12:43 -04:00
2025-06-11 12:13:36 -04:00
2024-12-23 07:33:26 -08:00
2024-12-21 13:01:48 +01:00