Fix unions with zero variants

This commit is contained in:
gingerBill committed 2019-07-07 14:38:11 +01:00
1 parent b77c79294c
commit d99ffe604f
3 files changed
+11 -7

No files matched your search

+5
View File
@@ -1306,6 +1306,11 @@ fmt_value :: proc(fi: ^Info, v: any, verb: rune) {
}
case runtime.Type_Info_Union:
if type_info.size == 0 {
strings.write_string(fi.buf, "nil");
return;
}
tag_ptr := uintptr(v.data) + info.tag_offset;
tag_any := any{rawptr(tag_ptr), info.tag_type.id};