diff options
Diffstat (limited to 'src/llvm_backend_expr.cpp')
| -rw-r--r-- | src/llvm_backend_expr.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/llvm_backend_expr.cpp b/src/llvm_backend_expr.cpp index 69443c9a3..143e38a8d 100644 --- a/src/llvm_backend_expr.cpp +++ b/src/llvm_backend_expr.cpp @@ -1486,12 +1486,12 @@ gb_internal lbValue lb_emit_conv(lbProcedure *p, lbValue value, Type *t) { GB_ASSERT(src != nullptr); GB_ASSERT(dst != nullptr); + if (is_type_untyped_uninit(src)) { + return lb_const_undef(m, t); + } if (is_type_untyped_nil(src)) { return lb_const_nil(m, t); } - if (is_type_untyped_undef(src)) { - return lb_const_undef(m, t); - } if (LLVMIsConstant(value.value)) { if (is_type_any(dst)) { @@ -2132,12 +2132,12 @@ gb_internal lbValue lb_emit_conv(lbProcedure *p, lbValue value, Type *t) { if (is_type_any(dst)) { + if (is_type_untyped_uninit(src)) { + return lb_const_undef(p->module, t); + } if (is_type_untyped_nil(src)) { return lb_const_nil(p->module, t); } - if (is_type_untyped_undef(src)) { - return lb_const_undef(p->module, t); - } lbAddr result = lb_add_local_generated(p, t, true); @@ -3136,11 +3136,11 @@ gb_internal lbValue lb_build_expr_internal(lbProcedure *p, Ast *expr) { return lb_addr_load(p, lb_build_addr(p, expr)); case_end; - case_ast_node(u, Undef, expr) + case_ast_node(u, Uninit, expr) lbValue res = {}; if (is_type_untyped(type)) { res.value = nullptr; - res.type = t_untyped_undef; + res.type = t_untyped_uninit; } else { res.value = LLVMGetUndef(lb_type(m, type)); res.type = type; |