2
0
mirror of https://github.com/boostorg/json.git synced 2026-02-09 11:12:37 +00:00
Commit Graph

953 Commits

Author SHA1 Message Date
Dmitry Arkhipov
c6508328c8 implement std::hash support via boost::hash 2023-01-02 12:37:41 +03:00
Dmitry Arkhipov
73946424a3 add boost::hash support 2023-01-02 12:37:41 +03:00
Dmitry Arkhipov
dc5d44d9dc remove useless tests 2023-01-02 12:37:41 +03:00
Max Kellermann
0f987f07d7 basic_parser: make sentinel() return a unique pointer
Right now, sentinel() casts the `basic_parser` pointer (`this`) to
`const char *`, but that pointer is not unique if the input buffer
happens to be placed right before the `basic_parser_impl` instance -
the end of that buffer then has the same address as `basic_parser`.

Example code:

```
  struct {
    char buffer[8]{"{\"12345\""};
    boost::json::stream_parser p;
  } s;
  s.p.write(s.buffer, sizeof(s.buffer));
  s.p.write(":0}", 3);
```

This stops parsing at the end of the buffer, and then the
`incomplete()` check in `parse_string()` will return true; the second
`write()` call will crash with assertion failure:

> boost/json/basic_parser_impl.hpp:1016: const char* boost::json::basic_parser<Handler>::parse_unescaped(const char*, std::integral_constant<bool, StackEmpty_>, std::integral_constant<bool, AllowComments_>, bool) [with bool StackEmpty_ = true; bool IsKey_ = true; Handler = boost::json::detail::handler]: Assertion `*cs == '\x22'' failed.

This changes `sentinel()` by adding 1 to guaranteed that the sentinel
pointer is unique even if the input buffers borders on this object.
2022-12-30 15:18:00 +01:00
Dmitry Arkhipov
6af3a5e05c guard std::min from windows.h 2022-12-19 22:58:47 +03:00
Dmitry Arkhipov
d310eb68eb Merge branch 'master' into develop 2022-12-19 20:47:27 +03:00
Dmitry Arkhipov
31b10c1b70 fix typo boost-1.81.0 2022-12-05 22:58:27 +03:00
Dmitry Arkhipov
ba335b07a9 1.81.0 release notes 2022-12-05 22:58:24 +03:00
Dmitry Arkhipov
8f837197a0 rewrite conversion docs 2022-12-05 22:46:46 +03:00
Dmitry Arkhipov
a0efa67944 dropped doc section numbering in files
The numbering made rearranging document sections tedious.
2022-12-05 22:46:46 +03:00
Dmitry Arkhipov
4ccf2141d9 fix value_from support for proxy iterators 2022-12-05 22:46:46 +03:00
Dmitry Arkhipov
6bb38cbfb1 fix conversion warning on 32 bit platforms 2022-12-05 22:46:46 +03:00
Dmitry Arkhipov
c5e5b54aad fix pedantic warnings 2022-12-05 22:27:44 +03:00
Dmitry Arkhipov
61b9d0afc4 refactor operator>>(istream&, value&) 2022-12-05 22:25:53 +03:00
Dmitry Arkhipov
905bf5b3a1 fix typo 2022-12-01 23:09:38 +03:00
Dmitry Arkhipov
c67d23f6df 1.81.0 release notes 2022-12-01 23:09:38 +03:00
Dmitry Arkhipov
212c0f2fd3 rewrite conversion docs 2022-11-28 17:46:24 +03:00
Dmitry Arkhipov
ca82d815b9 dropped doc section numbering in files
The numbering made rearranging document sections tedious.
2022-11-20 19:29:02 +03:00
Dmitry Arkhipov
893df142b6 fix value_from support for proxy iterators 2022-11-20 19:25:35 +03:00
Dmitry Arkhipov
f993635f4d fix pedantic warnings 2022-11-16 22:05:16 +03:00
Dmitry Arkhipov
71becfc308 use another template parameter names
Avoids clash with an X11 define
boost-1.81.0.beta1
2022-11-13 20:31:16 -05:00
sdarwin
e979855f46 CI macOS tests 2022-11-12 17:18:55 +03:00
Dmitry Arkhipov
719aabd087 fix conversion warning on 32 bit platforms 2022-11-11 23:47:48 +03:00
Dmitry Arkhipov
f2b64102cf use another template parameter names
Avoids clash with an X11 define
2022-11-11 23:14:06 +03:00
Dmitry Arkhipov
a708e9f25c pointer_token::iterator is actually an Iterator 2022-11-11 17:48:35 +03:00
Dmitry Arkhipov
4d224096ce refactor operator>>(istream&, value&) 2022-11-06 12:21:56 +03:00
Dmitry Arkhipov
ea45843a3e refactor parse(istream&, ec&) 2022-11-05 19:07:55 +03:00
Dmitry Arkhipov
340442779f parse overload for std::istream 2022-11-05 16:38:29 +03:00
Dmitry Arkhipov
9f20452e05 operator>> for value 2022-11-05 16:37:27 +03:00
Dmitry Arkhipov
77c05d2031 silence msvc-14.0 warning 2022-11-02 17:23:33 +03:00
Dmitry Arkhipov
1dda94811f add debug builds to Drone CI 2022-11-02 15:06:12 +03:00
Dmitry Arkhipov
fafba88549 increase version of thirdparty actions 2022-11-02 15:05:27 +03:00
Dmitry Arkhipov
4868e5d61b remove GHA build jobs 2022-11-02 15:02:44 +03:00
Dmitry Arkhipov
d88c48c892 add missing header 2022-10-28 14:46:36 +03:00
Dmitry Arkhipov
aaa16ed8cc fix name in copyright attribution 2022-10-27 18:08:45 +03:00
Dmitry Arkhipov
3191193dfb add Dmitry Arkhipov to list of maintainers 2022-10-25 17:39:55 +03:00
Dmitry Arkhipov
7d4b9cdefa move operator<< overloads to corresponding headers 2022-10-24 15:48:22 +03:00
Dmitry Arkhipov
77c94f5cd2 rvalue-ref accessors 2022-10-24 14:57:09 +03:00
Dmitry Arkhipov
213726054b fix duplicate word in value docs 2022-10-24 14:56:55 +03:00
Dmitry Arkhipov
59abf5dbf0 fix duplicate word in serialization docs 2022-10-24 11:50:34 +03:00
Dmitry Arkhipov
811d709677 warn about std::getline combined with allow_comments 2022-10-22 17:37:36 +03:00
Dmitry Arkhipov
69bf0bbb49 replace C fp constants with C++ equivalents 2022-10-22 16:48:59 +03:00
Dmitry Arkhipov
c130202491 add handling for missing error codes 2022-10-21 13:26:23 +03:00
Dmitry Arkhipov
307413405a add forward declarations 2022-10-20 22:57:17 +03:00
Dmitry Arkhipov
76e1dba8ba value_to/from supports described enums 2022-10-20 21:02:48 +03:00
Dmitry Arkhipov
ce2b5f82ac value_to/from supports described structs 2022-10-20 21:02:48 +03:00
Dmitry Arkhipov
fde4e87877 remove generic_category alias 2022-10-19 17:43:19 +03:00
Dmitry Arkhipov
d1ecadde2b error condition for generic library errors 2022-10-19 17:28:32 +03:00
Dmitry Arkhipov
74bac2c749 remove condition::assign_error 2022-10-19 17:28:32 +03:00
Dmitry Arkhipov
413c6725e7 move merge value_traits.hpp into impl/conversion.hpp 2022-10-19 17:25:35 +03:00