Fix type info generation

The problem: entry's index != entry->value in info_type_map
But I was assuming this
This commit is contained in:
Ginger Bill
2016-09-22 13:34:14 +01:00
parent 664c2cd7a5
commit 6907951f1e
7 changed files with 119 additions and 51 deletions
+7 -3
View File
@@ -419,11 +419,15 @@ print_any_to_buffer :: proc(buf: ^[]byte, arg: any) {
print_bool_to_buffer(buf, v)
case Pointer:
v := null;
if arg.data != null {
v = (arg.data as ^rawptr)^
if arg.type_info == type_info(^Type_Info) {
print_type_to_buffer(buf, (arg.data as ^^Type_Info)^)
} else {
print_pointer_to_buffer(buf, (arg.data as ^rawptr)^)
}
} else {
print_pointer_to_buffer(buf, null)
}
print_pointer_to_buffer(buf, v)
case Enum:
value: i64 = 0