diff options
| author | John Schmidt <john.schmidt.h@gmail.com> | 2023-02-04 18:28:36 +0100 |
|---|---|---|
| committer | John Schmidt <john.schmidt.h@gmail.com> | 2023-02-04 18:28:36 +0100 |
| commit | 73c857415eafc1d0856b6917cada94d8acde41e0 (patch) | |
| tree | 7278b0ccd1a7b0d74ff84c701238a72fd563bdd6 /lib/std/json.zig | |
| parent | c1f71963a9b8c913acee0fc167e0a4ecdecd2890 (diff) | |
| download | zig-73c857415eafc1d0856b6917cada94d8acde41e0.tar.gz zig-73c857415eafc1d0856b6917cada94d8acde41e0.zip | |
std.json: fix parsing of structs with default value const pointers
Diffstat (limited to 'lib/std/json.zig')
| -rw-r--r-- | lib/std/json.zig | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/std/json.zig b/lib/std/json.zig index 92afeead90..41bfb30bc5 100644 --- a/lib/std/json.zig +++ b/lib/std/json.zig @@ -1639,7 +1639,7 @@ fn parseInternal( const allocator = options.allocator orelse return error.AllocatorRequired; switch (ptrInfo.size) { .One => { - const r: T = try allocator.create(ptrInfo.child); + const r: *ptrInfo.child = try allocator.create(ptrInfo.child); errdefer allocator.destroy(r); r.* = try parseInternal(ptrInfo.child, token, tokens, options); return r; |
