aboutsummaryrefslogtreecommitdiff
path: root/src/ir.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ir.cpp')
-rw-r--r--src/ir.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/ir.cpp b/src/ir.cpp
index 2b6917d0d..b14943d23 100644
--- a/src/ir.cpp
+++ b/src/ir.cpp
@@ -1298,6 +1298,8 @@ irValue *ir_instr_if(irProcedure *p, irValue *cond, irBlock *true_block, irBlock
irValue *ir_instr_phi(irProcedure *p, Array<irValue *> edges, Type *type) {
+ GB_ASSERT(is_type_typed(type));
+
irValue *v = ir_alloc_instr(p, irInstr_Phi);
irInstr *i = &v->Instr;
i->Phi.edges = edges;
@@ -7167,7 +7169,7 @@ irValue *ir_build_expr_internal(irProcedure *proc, Ast *expr) {
irValue *cond = ir_build_cond(proc, te->cond, then, else_);
ir_start_block(proc, then);
- Type *type = type_of_expr(expr);
+ Type *type = default_type(type_of_expr(expr));
ir_open_scope(proc);
array_add(&edges, ir_emit_conv(proc, ir_build_expr(proc, te->x), type));
@@ -7199,7 +7201,7 @@ irValue *ir_build_expr_internal(irProcedure *proc, Ast *expr) {
irValue *cond = ir_build_cond(proc, te->cond, then, else_);
ir_start_block(proc, then);
- Type *type = type_of_expr(expr);
+ Type *type = default_type(type_of_expr(expr));
ir_open_scope(proc);
array_add(&edges, ir_emit_conv(proc, ir_build_expr(proc, te->x), type));