This commit is contained in:
gingerBill
2024-03-06 11:49:17 +00:00
parent 7ae22b7ce5
commit 5eef29290c
3 changed files with 15 additions and 7 deletions
+6
View File
@@ -411,6 +411,12 @@ unmarshal_object :: proc(p: ^Parser, v: any, end_token: Token_Kind) -> (err: Unm
continue struct_loop
} else {
// allows skipping unused struct fields
// NOTE(bill): prevent possible memory leak if a string is unquoted
allocator := p.allocator
defer p.allocator = allocator
p.allocator = mem.nil_allocator()
parse_value(p) or_return
if parse_comma(p) {
break struct_loop