aboutsummaryrefslogtreecommitdiff
path: root/lib/std/json.zig
diff options
context:
space:
mode:
authorJohn Schmidt <john.schmidt.h@gmail.com>2023-02-04 18:28:36 +0100
committerJohn Schmidt <john.schmidt.h@gmail.com>2023-02-04 18:28:36 +0100
commit73c857415eafc1d0856b6917cada94d8acde41e0 (patch)
tree7278b0ccd1a7b0d74ff84c701238a72fd563bdd6 /lib/std/json.zig
parentc1f71963a9b8c913acee0fc167e0a4ecdecd2890 (diff)
downloadzig-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.zig2
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;