aboutsummaryrefslogtreecommitdiff
path: root/src/ir.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2017-11-10 22:37:38 +0000
committergingerBill <bill@gingerbill.org>2017-11-10 22:37:38 +0000
commit53b3ad186f6c3ba27f308466f44de89ea1e91638 (patch)
treee3a6883bb7261458c75f79aba2d7adc5a96161e2 /src/ir.cpp
parent82c1c5b3fe408df0086cb36c06a054e0126fbebd (diff)
Fix untyped type IR bug
Diffstat (limited to 'src/ir.cpp')
-rw-r--r--src/ir.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/ir.cpp b/src/ir.cpp
index d8f33a355..e5aaa06cd 100644
--- a/src/ir.cpp
+++ b/src/ir.cpp
@@ -1380,6 +1380,7 @@ irValue *ir_add_local_for_identifier(irProcedure *proc, AstNode *ident, bool zer
irValue *ir_add_local_generated(irProcedure *proc, Type *type, bool zero_initialized = true) {
GB_ASSERT(type != nullptr);
+ type = default_type(type);
Scope *scope = nullptr;
if (proc->curr_block) {
@@ -1395,6 +1396,8 @@ irValue *ir_add_local_generated(irProcedure *proc, Type *type, bool zero_initial
irValue *ir_add_global_generated(irModule *m, Type *type, irValue *value) {
GB_ASSERT(type != nullptr);
+ type = default_type(type);
+
gbAllocator a = m->allocator;
isize max_len = 7+8+1;