mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-05 23:28:48 +00:00
Fix #3173
This commit is contained in:
@@ -382,6 +382,11 @@ marshal_to_writer :: proc(w: io.Writer, v: any, opt: ^Marshal_Options) -> (err:
|
|||||||
opt_write_end(w, opt, '}') or_return
|
opt_write_end(w, opt, '}') or_return
|
||||||
|
|
||||||
case runtime.Type_Info_Union:
|
case runtime.Type_Info_Union:
|
||||||
|
if len(info.variants) == 0 || v.data == nil {
|
||||||
|
io.write_string(w, "null") or_return
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
tag_ptr := uintptr(v.data) + info.tag_offset
|
tag_ptr := uintptr(v.data) + info.tag_offset
|
||||||
tag_any := any{rawptr(tag_ptr), info.tag_type.id}
|
tag_any := any{rawptr(tag_ptr), info.tag_type.id}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user