aboutsummaryrefslogtreecommitdiff
path: root/src/codegen.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/codegen.cpp')
-rw-r--r--src/codegen.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/codegen.cpp b/src/codegen.cpp
index 008ec9b395..78592e4d09 100644
--- a/src/codegen.cpp
+++ b/src/codegen.cpp
@@ -916,11 +916,12 @@ static LLVMValueRef gen_prefix_op_expr(CodeGen *g, AstNode *node) {
TypeTableEntry *child_type = expr_type->data.error.child_type;
// TODO in debug mode, put a panic here if the error is not 0
if (child_type->size_in_bits > 0) {
+ add_debug_source_node(g, node);
LLVMValueRef child_val_ptr = LLVMBuildStructGEP(g->builder, expr_val, 1, "");
if (handle_is_ptr(child_type)) {
return child_val_ptr;
} else {
- return expr_val;
+ return LLVMBuildLoad(g->builder, child_val_ptr, "");
}
} else {
return nullptr;