From 6907951f1eebcc9053ccfbe32a30dc704e790747 Mon Sep 17 00:00:00 2001 From: Ginger Bill Date: Thu, 22 Sep 2016 13:34:14 +0100 Subject: Fix type info generation The problem: entry's index != entry->value in info_type_map But I was assuming this --- src/codegen/codegen.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/codegen/codegen.cpp') diff --git a/src/codegen/codegen.cpp b/src/codegen/codegen.cpp index e021069b2..4a4a7da46 100644 --- a/src/codegen/codegen.cpp +++ b/src/codegen/codegen.cpp @@ -302,9 +302,12 @@ void ssa_gen_tree(ssaGen *s) { }; - gb_for_array(entry_index, info->type_info_map.entries) { - auto *entry = &info->type_info_map.entries[entry_index]; + gb_for_array(type_info_map_index, info->type_info_map.entries) { + auto *entry = &info->type_info_map.entries[type_info_map_index]; Type *t = cast(Type *)cast(uintptr)entry->key.key; + t = default_type(t); + isize entry_index = entry->value; + ssaValue *tag = NULL; -- cgit v1.2.3