aboutsummaryrefslogtreecommitdiff
path: root/src/codegen/codegen.cpp
diff options
context:
space:
mode:
authorGinger Bill <github@gingerbill.org>2016-09-22 13:34:14 +0100
committerGinger Bill <github@gingerbill.org>2016-09-22 13:34:14 +0100
commit6907951f1eebcc9053ccfbe32a30dc704e790747 (patch)
treefb202a7f52e7d3f7d70362aa0a2436ba82080194 /src/codegen/codegen.cpp
parent664c2cd7a587feb18f02378506bdade2503343d3 (diff)
Fix type info generation
The problem: entry's index != entry->value in info_type_map But I was assuming this
Diffstat (limited to 'src/codegen/codegen.cpp')
-rw-r--r--src/codegen/codegen.cpp7
1 files changed, 5 insertions, 2 deletions
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;