Fix unions with zero variants

This commit is contained in:
gingerBill
2019-07-07 14:38:11 +01:00
parent b77c79294c
commit d99ffe604f
3 changed files with 11 additions and 7 deletions
+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};