Niels Lohmann
57424ab0b5
Match literals without a stack array and keep parser states in bytes
...
scan_after_whitespace() built the expected text of true, false, and null in
local std::array objects. With -fstack-protector-strong (the default of
Ubuntu's GCC, among others), a local array gives the function a stack canary
check, which then ran on every token. scan_literal() now takes the text
after the first character as a string literal, with its length as a template
parameter; for contiguous input it compares the rest at once and falls back
to the byte loop on a mismatch, so errors are reported at the same
character. It is out of line, which keeps the token dispatch small.
The parser kept the nesting of arrays and objects in a std::vector<bool>,
whose push_back() GCC calls out of line; it is a std::vector<std::uint8_t>
now.
Signed-off-by: Niels Lohmann <mail@nlohmann.me >
2026-10-15 18:37:05 +02:00
..
2026-10-11 08:24:31 +02:00
2026-10-11 08:24:31 +02:00
2026-10-14 17:38:36 +02:00
2026-10-11 08:21:13 +02:00
2026-01-01 20:00:39 +01:00
2026-10-11 08:21:13 +02:00
2026-10-11 08:21:13 +02:00
2026-10-11 08:21:13 +02:00
2026-10-11 08:21:13 +02:00
2026-10-11 08:21:13 +02:00
2026-10-11 08:21:13 +02:00
2026-10-11 08:21:13 +02:00
2026-01-01 20:00:39 +01:00
2026-10-01 07:33:07 +02:00
2026-10-01 07:33:07 +02:00
2026-10-11 08:21:13 +02:00
2026-09-16 20:15:46 +02:00
2026-10-06 22:53:03 +02:00
2026-10-01 07:33:07 +02:00
2026-07-08 16:40:58 +02:00
2026-10-08 16:11:16 +02:00
2026-10-06 22:33:29 +02:00
2026-10-01 07:37:47 +02:00
2026-10-14 17:38:37 +02:00
2026-10-09 17:05:36 +02:00
2026-10-04 17:18:19 +02:00
2026-10-01 07:37:47 +02:00
2026-10-07 19:17:18 +02:00
2026-10-11 08:22:00 +02:00
2026-10-07 07:39:05 +02:00
2026-10-09 16:56:14 +02:00
2026-09-16 20:15:46 +02:00
2026-10-01 07:37:47 +02:00
2026-10-10 00:05:02 +02:00
2026-09-27 14:19:22 +02:00
2026-01-01 20:00:39 +01:00
2026-10-15 18:37:05 +02:00
2026-10-15 18:37:02 +02:00
2026-10-08 16:11:16 +02:00
2026-01-01 20:00:39 +01:00
2026-09-30 20:07:52 +02:00
2026-10-02 11:23:55 +02:00
2026-09-11 08:22:50 +02:00
2026-10-04 17:18:19 +02:00
2026-10-06 07:22:55 +02:00
2026-10-08 16:11:16 +02:00
2026-10-09 16:56:14 +02:00
2026-10-13 17:16:52 +02:00
2026-10-11 08:24:31 +02:00
2026-10-11 08:24:31 +02:00
2026-10-11 08:24:31 +02:00
2026-10-11 08:24:31 +02:00
2026-10-11 08:24:31 +02:00
2026-10-10 00:05:02 +02:00
2026-10-08 16:11:16 +02:00
2026-10-06 07:22:55 +02:00
2026-10-13 17:16:52 +02:00
2026-09-30 21:36:04 +02:00
2026-10-07 16:37:19 +02:00
2026-10-12 09:33:43 +02:00
2026-09-30 20:53:56 +02:00
2026-10-04 17:18:19 +02:00
2026-09-30 20:07:06 +02:00
2026-10-11 08:21:41 +02:00
2026-10-04 17:54:05 +02:00
2026-10-04 17:54:05 +02:00
2026-09-27 16:56:21 +02:00
2026-10-14 21:30:07 +02:00
2026-07-02 15:59:36 +02:00
2026-10-08 16:11:16 +02:00
2026-01-01 20:00:39 +01:00
2026-09-09 09:52:58 +02:00
2026-10-04 22:11:34 +02:00
2026-01-01 20:00:39 +01:00
2026-10-01 07:33:07 +02:00
2026-01-01 20:00:39 +01:00
2026-10-11 08:21:41 +02:00
2026-10-11 08:21:41 +02:00
2026-10-11 10:27:16 +02:00
2026-10-14 17:38:36 +02:00
2026-10-12 09:33:43 +02:00
2026-10-01 07:37:47 +02:00
2026-01-01 20:00:39 +01:00
2026-10-04 17:18:19 +02:00
2026-10-06 22:53:03 +02:00
2026-10-10 00:05:02 +02:00
2026-09-30 20:08:17 +02:00
2026-09-16 20:15:46 +02:00
2026-09-09 09:48:17 +02:00
2026-09-16 20:15:46 +02:00
2026-10-02 17:25:17 +02:00
2026-10-09 16:56:14 +02:00
2026-10-04 11:46:25 +02:00
2026-10-04 17:18:19 +02:00
2026-10-02 11:23:55 +02:00
2026-10-14 17:26:38 +02:00
2026-10-01 07:33:07 +02:00
2026-01-01 20:00:39 +01:00
2026-10-08 16:11:16 +02:00
2026-10-08 16:11:16 +02:00
2026-10-13 17:16:52 +02:00
2026-10-08 16:11:16 +02:00
2026-09-27 14:19:22 +02:00
2026-10-15 18:37:05 +02:00
2026-01-01 20:00:39 +01:00
2026-10-14 17:38:37 +02:00
2026-10-04 11:50:42 +02:00
2026-10-07 08:50:12 +02:00
2026-01-01 20:00:39 +01:00
2026-09-25 20:44:30 +02:00
2026-10-06 22:33:29 +02:00
2026-10-07 19:17:57 +02:00
2026-10-01 07:37:47 +02:00
2026-01-01 20:00:39 +01:00
2026-10-04 17:18:19 +02:00
2026-09-30 22:49:24 +02:00
2026-10-01 07:37:47 +02:00