diff options
| author | gingerBill <bill@gingerbill.org> | 2019-01-28 12:13:37 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2019-01-28 12:13:37 +0000 |
| commit | e452765d286c83be5c443950132d045a2d311b7d (patch) | |
| tree | 87c284061eea7780a59d873fd5d441af1ba3875b /src | |
| parent | 2b80683fc7276a722cf66ca7e3716b2f9e23c0b5 (diff) | |
Patch minor IR bug
Diffstat (limited to 'src')
| -rw-r--r-- | src/ir.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/ir.cpp b/src/ir.cpp index 5d2f923aa..16f202c6a 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -6894,8 +6894,10 @@ irAddr ir_build_addr(irProcedure *proc, Ast *expr) { case_ast_node(be, BinaryExpr, expr); irValue *v = ir_build_expr(proc, expr); Type *t = ir_type(v); - GB_ASSERT(is_type_pointer(t)); - return ir_addr(v); + if (is_type_pointer(t)) { + return ir_addr(v); + } + return ir_addr(ir_address_from_load_or_generate_local(proc, v)); case_end; case_ast_node(ie, IndexExpr, expr); |