aboutsummaryrefslogtreecommitdiff
path: root/src/codegen.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2016-12-28 01:35:13 -0500
committerAndrew Kelley <superjoe30@gmail.com>2016-12-28 01:35:13 -0500
commit94f977a6c12f3c5877f404c51a01b1b32c8acaa6 (patch)
tree5a5836479fe671c5e8c29e64e9ba5eb8e914ab8e /src/codegen.cpp
parentf6ac2fa70e7e2eb5d3299dc90c581d139b0bea1b (diff)
downloadzig-94f977a6c12f3c5877f404c51a01b1b32c8acaa6.tar.gz
zig-94f977a6c12f3c5877f404c51a01b1b32c8acaa6.zip
IR: pass genericFnWithImplicitCast test
Diffstat (limited to 'src/codegen.cpp')
-rw-r--r--src/codegen.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/codegen.cpp b/src/codegen.cpp
index 21389aa89e..4a0b901687 100644
--- a/src/codegen.cpp
+++ b/src/codegen.cpp
@@ -1567,7 +1567,9 @@ static LLVMValueRef ir_render_asm(CodeGen *g, IrExecutable *executable, IrInstru
}
static LLVMValueRef gen_non_null_bit(CodeGen *g, TypeTableEntry *maybe_type, LLVMValueRef maybe_handle) {
- bool maybe_is_ptr = (maybe_type->id == TypeTableEntryIdPointer || maybe_type->id == TypeTableEntryIdFn);
+ assert(maybe_type->id == TypeTableEntryIdMaybe);
+ TypeTableEntry *child_type = maybe_type->data.maybe.child_type;
+ bool maybe_is_ptr = (child_type->id == TypeTableEntryIdPointer || child_type->id == TypeTableEntryIdFn);
if (maybe_is_ptr) {
return LLVMBuildICmp(g->builder, LLVMIntNE, maybe_handle, LLVMConstNull(maybe_type->type_ref), "");
} else {