From 2e6aa6d813cf3fd4180b8c9ffc671b4bcee54586 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Sun, 18 Dec 2016 13:55:34 -0500 Subject: IR: fix codegen of ref instruction --- src/codegen.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/codegen.cpp') diff --git a/src/codegen.cpp b/src/codegen.cpp index dd734cbf63..c6e5827154 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -2854,6 +2854,8 @@ static void do_code_gen(CodeGen *g) { } else if (instruction->id == IrInstructionIdRef) { IrInstructionRef *ref_instruction = (IrInstructionRef *)instruction; slot = &ref_instruction->tmp_ptr; + assert(instruction->type_entry->id == TypeTableEntryIdPointer); + slot_type = instruction->type_entry->data.pointer.child_type; } else if (instruction->id == IrInstructionIdContainerInitList) { IrInstructionContainerInitList *container_init_list_instruction = (IrInstructionContainerInitList *)instruction; slot = &container_init_list_instruction->tmp_ptr; -- cgit v1.2.3