diff options
| author | Ian Johnson <ian@ianjohnson.dev> | 2023-08-17 07:52:46 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-08-17 07:52:46 -0400 |
| commit | f3f554b9b89cc39cf00b4df68bd3455e8ef34984 (patch) | |
| tree | 819fed8d1bd38c4d6ce10dbdf1cc3def7aec5636 /src/Module.zig | |
| parent | 5395c2786a2ea9fd70e8c91aab099976216089aa (diff) | |
| download | zig-f3f554b9b89cc39cf00b4df68bd3455e8ef34984.tar.gz zig-f3f554b9b89cc39cf00b4df68bd3455e8ef34984.zip | |
std.json: avoid stale pointers when parsing Value (#16864)
Closes #16861
Using `alloc_if_needed` when parsing a `Value` allows receiving a token
which points to the buffer of the underlying `Reader`. This token will
no longer be valid after the `Reader`'s buffer is refilled, which will
happen with large values. Using `alloc_always` avoids this issue by
ensuring the returned tokens always own their data independently of the
underlying buffer.
Diffstat (limited to 'src/Module.zig')
0 files changed, 0 insertions, 0 deletions
